我在我的应用程序中做了一个新手引导流程,并想添加一个跳过按钮。 该按钮位于viewController上,因此我想通过访问app delegate窗口来将其移动到另一个viewController。
然而,它一直给我一个错误,指出AppDelegate.Type没有名为"window"的成员。
@IBAction func skipWalkthrough(sender: AnyObject) {
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
AppDelegate.window!.rootViewController = RootViewController
}
这种方法有什么问题吗?
提前感谢!