我正在try 创建推送通知,该通知根据推送获得的信息确定要打开哪个视图.
我已经设法从推送中获得了信息,但我现在正在努力打开视图
看看其他堆栈溢出问题,我目前有以下问题:
应用程序委派未完成加载:
//Extract the notification data
if let notificationPayload = launchOptions?[UIApplicationLaunchOptionsRemoteNotificationKey] as? NSDictionary {
// Get which page to open
let viewload = notificationPayload["view"] as? NSString
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
//Load correct view
if viewload == "circles" {
var viewController = self.window?.rootViewController?.storyboard?.instantiateViewControllerWithIdentifier("Circles") as! UIViewController
self.window?.rootViewController = viewController
}
}
目前,这在var ViewController=self上失败...线