0

in my app delegate this is how I navigate to my SWRevealViewController

let revealViewController = mainStoryboard.instantiateViewControllerWithIdentifier("RevealView") as? SWRevealViewController


        self.window!.rootViewController = revealViewController
        self.window?.makeKeyAndVisible()

I navigate to that inner view controller from the SWRevealViewController's FrontViewcontrollerlike this.

let secondViewController = self.storyboard?.instantiateViewControllerWithIdentifier("Read") as! ReadViewController
        secondViewController.title = self.selectedTitle
        self.navigationController?.pushViewController(secondViewController, animated: true)

Now in AppDelegate when receive a push notification I want to navigate this ReadViewController. and when I click the back button it should come back to the FrontViewController just like it happens in normal way. How can I do this in my notification delegates in AppDelegate Please help me. Thanks

user1960169
  • 3,533
  • 12
  • 39
  • 61

1 Answers1

0

Try this :

let yourVC = mainStoryboard.instantiateViewControllerWithIdentifier("Read") as! ReadViewController

let frontViewController = mainStoryboard.instantiateViewControllerWithIdentifier("frontViewController") as! FrontViewController

let navController = UINavigationController()
navController.viewControllers  = [yourVC,frontViewController]

self.window!.rootViewController = navController
self.window?.makeKeyAndVisible()
Bhadresh Mulsaniya
  • 2,610
  • 1
  • 12
  • 25
Rakshith Nandish
  • 599
  • 3
  • 13