title: Autolayout constraints and child view controller
body: <p>I have two view controllers, parent and child.</p>
  
  <p>So in the <code>viewDidLoad</code> method I do the following:</p>
  
  <pre><code>ChildViewController* childViewController = [[ChildViewController alloc] init];
  
  [self addChildViewController:childViewController];
  
  // ChildViewController sets his own constraints in viewDidLoad
  [self.view addSubview:childViewController.view];
  
  [childViewController didMoveToParentViewController:self];
  
  //
  // setup constraints to expand childViewController.view to 
  // fill the size of parent view controller
  //
  </code></pre>
  
  <p>So basically what happens is that <code>updateViewConstraints</code> is called on ChildViewController before parent controller constraints apply, so in fact <code>self.view.frame == CGRectZero</code>, exactly the same as I specified in custom <code>loadView</code> method in <code>ChildViewController</code>.</p>
  
  <p><code>translatesAutoresizingMaskIntoConstraints</code> all set to <code>NO</code> for all views.</p>
  
  <p>What's the proper way to setup constraints in this case so <code>ChildViewController</code> updates his constraints after parent?</p>
  
  <p>Current log from both controllers is pretty frustrating, I do not understand how updateViewConstraints can be called before viewWillLayoutSubviews:</p>
  
  <pre><code>App[47933:c07] ChildViewController::updateViewConstraints. RECT: {{0, 0}, {0, 0}}
  App[47933:c07] ParentViewController::updateViewConstraints
  App[47933:c07] ChildViewController:viewWillLayoutSubviews. RECT: {{0, 0}, {984, 454}}
  App[47933:c07] ChildViewController:viewDidLayoutSubviews. RECT: {{0, 0}, {984, 454}}
  </code></pre>