Skip to content

Instantly share code, notes, and snippets.

@e-sung
Created May 23, 2019 11:06
Show Gist options
  • Save e-sung/813086bc7bad1274114c858f62628ced to your computer and use it in GitHub Desktop.
Save e-sung/813086bc7bad1274114c858f62628ced to your computer and use it in GitHub Desktop.
class AppDelegate: UIApplicationDelegate {
func application(_ app: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler _: @escaping (UIBackgroundFetchResult) -> Void) {
rootNavigationController.navigate(with: userInfo)
}
}
class MyNavigationController: UINavigationController {
func navigate(with userInfo: [String: AnyObject?] {
let destination = userInfo["destination"]
if destination == ThirdViewController.className {
viewControllers = [FirstViewController.storyboardInstance, SecondViewController.storyboardInstance, ThirdViewController.storyboardInstance]
}
else if /// 등등...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment