在应用程序的某个区域,我想显示3个可能的View Controller
s之一。iOS/Swift:一个容器视图可容纳3个可能的视图控制器
我假设我能做到这一点通过添加Container View
这样的区域(如下图所示)
的问题是:
1)如何联结的3个孩子View Controller
s到这个故事板中的Container View
?我是否需要将Container View
连接到父母View Controller
,然后将其连接到3个孩子?
2)哪个是Swift代码来显示3个View Controller
之一,并隐藏其他2个?
https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html –
感谢您的链接。但是,如何将容器视图连接到故事板中的视图控制器?我是否需要使用此方法http://sandmoose.com/post/35714028270/storyboards-with-custom-container-view-controllers以及将ContainerView链接到子视图控制器的ContainerViewController? –