title: Resizing Child View Controllers in UIContainerView swift ios
body: <p>I am creating an app in which i have to open 2-3 view controller inside a view controller because I want to share same Sliding Drawer and Navigation bar for these view controllers. I have followed <a href="https://www.raywenderlich.com/78568/create-slide-out-navigation-panel-swift" rel="noreferrer">this</a> tutorial.</p>
  
  <p>I have used <strong>ContainerView</strong> inside <strong>MainController</strong> and child controllers are added properly but I am having difficulty in resizing the child controller to match containerview </p>
  
  <pre><code> self.mainContainer.addSubview(vc.view)
   self.mainContainer.translatesAutoresizingMaskIntoConstraints = false
   addChildViewController(vc)
   NSLayoutConstraint.activate([
   vc.view.leadingAnchor.constraint(equalTo:mainContainer.leadingAnchor),
   vc.view.trailingAnchor.constraint(equalTo: mainContainer.trailingAnchor),
   vc.view.topAnchor.constraint(equalTo: mainContainer.topAnchor),
   vc.view.bottomAnchor.constraint(equalTo: mainContainer.bottomAnchor)
   ])
  vc.didMove(toParentViewController: self)
  </code></pre>
  
  <p>and I am getting the following error </p>
  
  <pre><code>[LayoutConstraints] Unable to simultaneously satisfy constraints.
      Probably at least one of the constraints in the following list is one you don't want. 
      Try this: 
          (1) look at each constraint and try to figure out which you don't expect; 
          (2) find the code that added the unwanted constraint or constraints and fix it. 
      (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
  (
      "&lt;NSAutoresizingMaskLayoutConstraint:0x170095c70 h=-&amp;- v=-&amp;- UIView:0x127e17630.midY == UIView:0x127e15070.midY + 32   (active)&gt;",
      "&lt;NSLayoutConstraint:0x1740970c0 V:|-(0)-[UIView:0x127e17630]   (active, names: '|':UIView:0x127e15070 )&gt;",
      "&lt;NSLayoutConstraint:0x174097020 UIView:0x127e17630.bottom == UIView:0x127e15070.bottom   (active)&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x174097020 UIView:0x127e17630.bottom == UIView:0x127e15070.bottom   (active)&gt;
  </code></pre>
  
  <p>what I think is <strong>self.mainContainer.translatesAutoresizingMaskIntoConstraints = false</strong> is somehow not working
  Child View Controllers are not properly getting resized as in the main controller the <strong>navbar is about 64</strong> and the same height of portion is getting clipped in childview controllers from bottom. </p>
  
  <p><strong>MainController's elements Constraint</strong> </p>
  
  <ol>
  <li><p>navbar left=top=right = 0, height = 64</p></li>
  <li><p>UIContainerView left=right=bottom=0 and top to navbar = 0</p></li>
  </ol>