evnaz / ENSwiftSideMenu

A simple side menu for iOS written in Swift.
MIT License
1.82k stars 281 forks source link

navigationController.popViewControllerAnimated does not work? #83

Closed dsun29 closed 9 years ago

dsun29 commented 9 years ago

I use following code to come back to ViewController B to A, but it doesn't work

self.navigationController!.popViewControllerAnimated(true)

The code below was used to switch from A to B:

 let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)

 let nextViewController = storyBoard.instantiateViewControllerWithIdentifier("B") as! B

 sideMenuController()?.setContentViewController(nextViewController)
evnaz commented 9 years ago

Hi, Seems there is only one view controller in the navigation stack. You need to push view controller first, then you can perform popViewControllerAnimated

dsun29 commented 9 years ago

Thank you evnaz for your help!