I have a small iPhone app, which uses a navigation controller to display 3 views (here fullscreen):
For this problem, I think the answer is just simple as
Then set the array of ViewControllers back to the navigationController as bellow:
if let navController = self.navigationController {
let newVC = DestinationViewController(nibName: "DestinationViewController", bundle: nil)
var stack = navController.viewControllers
stack.remove(at: stack.count - 1) // remove current VC
stack.insert(newVC, at: stack.count) // add the new one
navController.setViewControllers(stack, animated: true) // boom!
}
works perfectly with Swift 3.
Hope it helps for some new guys.
Cheers.