Many tutorials describe methods for adding multiple child view controllers in the Storyboard, why don't they just add multiple container views? [closed]

China☆狼群 提交于 2019-12-11 17:54:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!