0
我在我的应用程序中配置Handoff。对于以这种方式构成的应用在AppDelegate中运行一个不是第一个控制器的方法
(Entry Point)
- >UINavigationController
- >InterestedViewController
这就够了:
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void) -> Bool {
if let win = self.window {
let navController = win.rootViewController as! UINavigationController
let viewController = navController.topViewController as! myViewController
viewController.restoreUserActivityState(userActivity)
}
return true
}
当应用程序使用Handooff,在AppDelegate中这种方法运行启动,在“myViewController”中启动方法func restoreUserActivityState(activity: NSUserActivity)
,一切正常。
麻烦的是,我的应用程序以另一种方式构成:
(Entry Point)
- >Another ViewController with animated logo
- >UINavigationController
- >InterestedViewController
所以前面的代码无法正常工作。我无法理解如何修改代码...