【发布时间】:2015-07-13 16:48:06
【问题描述】:
我在我的应用中进行了演练(入职流程),我想要一个跳过按钮。 该按钮位于 viewController 上,因此我发现移动到另一个 viewController 的最佳方法是访问应用程序委托窗口。
但是,AppDelegate.Type 没有名为“window”的成员时,我一直收到错误消息。
@IBAction func skipWalkthrough(sender: AnyObject) {
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
AppDelegate.window!.rootViewController = RootViewController
}
这样的做法有什么问题吗?
提前致谢!
【问题讨论】:
-
你也可以尝试获取可见的viewcontroller
标签: ios swift uiviewcontroller appdelegate