Я пытаюсь создать push-уведомление, которое определяет, какой вид открывается в соответствии с информацией, полученной от нажатия.
Мне удалось получить информацию из push, но теперь я пытаюсь открыть представление
Рассматривая другие вопросы, у меня есть следующее:
Участник приложения закончил загрузку:
//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...