Controlling which view controller loads after receiving a push notification in SWIFT
Updated for Swift 4.2 Like it was said, you want to register to remote notifications in applicationDidLaunchWithOptions : func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { let pushSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) UIApplication.shared.registerUserNotificationSettings(pushSettings) UIApplication.shared.registerForRemoteNotifications() } There is no way to know in which viewController you will be when you … Read more