title: Who's responsible for calling viewWillLayoutSubviews()/viewDidLayoutSubviews() in a custom UIViewController container?
body: <p>When creating a custom <code>UIViewController</code> container (a <code>UIViewController</code> that contains other UIViewControllers and their views) who is responsible for calling <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/viewWillLayoutSubviews" rel="nofollow">viewWillLayoutSubviews</a> and <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/viewDidLayoutSubviews" rel="nofollow">viewDidLayoutSubviews</a>? My container class has two sub-controllers of which neither is having these methods called when it moves to the parent view controller.</p>
  
  <p>UIViewController's <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/beginAppearanceTransition:animated:" rel="nofollow">beginAppearanceTransition(_:animated:)</a> is documented as being the right way to trigger <code>viewWillAppear()</code>, <code>viewWillDisappear()</code>, <code>viewDidAppear()</code>, and <code>viewDidDisappear()</code> but I see no equivalent for <code>viewWillLayoutSubviews()</code> / <code>viewDidLayoutSubviews()</code>.</p>
  
  <p>As best I can figure the parent view controller (which in this case is being presented via <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/presentViewController:animated:completion:" rel="nofollow">presentViewController(_:animated:completion:)</a>) is responsible for calling its sub-controllers <code>viewWillLayoutSubviews()</code> / <code>viewDidLayoutSubviews()</code> in its own implementation of those same methods. The framework seems to call these methods under certain circumstances (like when you set the <code>rootViewController</code> property of <code>UIWindow</code>) but not others (like when you call <code>addChildViewController()</code> in <code>UIViewController</code>).</p>
  
  <p>Is this the correct, idiomatic way to go about things?</p>