I'm opening a navigation controller from a button click of my main view controller.
I programatically created a left bar button item on the navigation controller which I want to dismiss the nav controller and go back to my main controller.
I'm essentially going back on the root view controller of the navigation controller.
I've tried
navigationController?.dismissViewControllerAnimated(true, completion: nil)
and
self.dismissViewControllerAnimated(true, completion: nil)
and get an NSException on both.
Please advise.
UIViewController
? – Sohil R. MemonrootViewController
itself. what exception you are getting, BTW? – Suryakant Sharma