2容器視圖控制器:custom your container view controller
* What is the role of the container and what role do its children play?
* How many children are displayed simultaneously?
* What is the relationship (if any) between sibling view controllers?
* How are child view controllers added to or removed from the container?
* Can the size or position of the children change? Under what conditions do those changes occur?
* Does the container provide any decorative or navigation-related views of its own?
* What kind of communication is required between the container and its children? Does the container need to report specific events to its children other than the standard ones defined by the UIViewController class?
* Can the appearance of the container be configured in different ways? If so, how?
* Can the size or position of the children change? Under what conditions do those changes occur?The parent-child relationship ensures that the children receive any relevant system messages.most of the real work happens during the layout and management of the contained viewsAdding a Child View Controller to Your Content
* Call the addChildViewController: method of your container view controller. This method tells UIKit that your container view controller is now managing the view of the child view controller.
* Add the child’s root view to your container’s view hierarchy.Always remember to set the size and position of the child’s frame as part of this process.
* Add any constraints for managing the size and position of the child’s root view.
*
* Call the didMoveToParentViewController: method of the child view controller.set up constraintsDo not alter the contents of the root view or any other views in the child’s view hierarchy.Removing a Child View Controller
*
* Call the child’s willMoveToParentViewController: method with the value nil.
* Remove any constraints that you configured with the child’s root view.
* Remove the child’s root view from your container’s view hierarchy.
* Call the child’s removeFromParentViewController method to finalize the end of the parent-child relationship. A child view controller should focus on its own content.Let a child view controller determine the status bar style.Let the child specify its own preferred size.