I would like to know if there is a way to go back to the previous UINavigationController
so that I do not have to re-instantiate it, this is because I want to pass a variable to the previous view controller and then go to it without need to instantiate it again.
The thing is that the current view controller is inside a new UINavigation
, I leave the code:
let vc:TotalSlidesViewController = self.storyboard?.instantiateViewControllerWithIdentifier("TotalSlidesViewController") as! TotalSlidesViewController
vc.previousVC = self
navigationVC = UINavigationController.init(rootViewController: vc)
self.navigationController?.presentViewController(navigationVC, animated: true, completion:nil)
And then when I want to go back in the Second ViewController:
previousVC.itemsCollection.appendContentsOf(slidesAdded)
Here would go the part where I have to go back, if I do popToRoot
it does not work since I'm already at the beginning of the current UINavigationController
.