I am getting this error when I call my method dismissView. Here is the method stub:
-(IBAction)dismissView
{
RootViewController *rootController = [[RootViewC
Swift 4
For anyone still looking for a better solution that doesn't involve the UINavigationController stack indexes, which is getting more problematic with bigger navigation stack - here's the easiest way to solve this:
if let destinationViewController = navigationController?.viewControllers
.filter(
{$0 is DestinationViewController})
.first {
navigationController?.popToViewController(destinationViewController, animated: true)
}