如何在ContainerView中切换ViewController?

时间:2013-04-03 21:57:38

标签: iphone ios objective-c uiviewcontroller

我在另一个ViewController中添加了一个容器视图。由此,我真的不知道如何在ContainerView内部的ViewController之间进行切换。

容器视图:

container view

ContainerView中的默认ViewController(故事板ID为“firstView”): enter image description here

我有一个最后的ViewController(故事板ID为“secondView”)

由此,如何在Container View中切换firstView和secondView?如何获得ContainerView,firstView和secondView的插座?如果这不是正确的方法,有人可以帮助我实现我想要的吗?

(我已经检查了苹果的文档但没找到我需要的东西:()

谢谢:)

1 个答案:

答案 0 :(得分:0)

只需将控制器的视图添加到容器视图中即可。

[controller.containerView addSubview: othercontroller.view]
相关问题