我想以编程方式使用Apple的新Swift语言从viewController移动到另一个.我用Google搜索并阅读了文档,我看到了如何使用单个ViewController.有没有人有关于如何在视图控制器之间切换的示例或文档?
在类文档中有很多方法可以做到这一点UIViewController
.
示例1
以下是使用该-presentViewConroller:
方法的示例(假设此代码是在UIViewController
子类中编写的):
var secondViewController = UIViewController() //create your second view controller. self.presentViewController(secondViewController, true, NULL)
示例2
这是您如何呈现第二个UIViewController
故事板(再次假设此代码是在UIViewController
子类中编写的):
self.preformSegueWithIdentifier("segueIdentfier", self);