问题
Many tutorials, such as this one go over how to add multiple child view controllers via the Storyboard. But this tutorial just adds multiple container views in the Storyboard.
Why is the first tutorial (and many others) going through such hoops to create multiple child view controllers if they could just use multiple view containers? Is this a new feature, or am I just misunderstanding what's going on?
回答1:
As the other poster said, container views and embed segues were added in iOS 6. In iOS 5 adding child view controllers was more work since these options were not available.
Container views and embed segues only work with storyboards. Some developers don't like and don't use storyboards. In that case you would have to set up your child view controllers yourself.
I think container views and embed segues are wonderful, and make setting things up much easier. By all means use them. They do most/all of the housekeeping for you.
来源:https://stackoverflow.com/questions/20548492/many-tutorials-describe-methods-for-adding-multiple-child-view-controllers-in-th