Quickly returning to RootViewController

cocoa-touch, ios, iphone, objective-c, uiviewcontroller

Solution

First I think you need to dismiss presented model then you can pop all the pushed view controllers. As presented model would not be in the stack of the navigation.

[self dismissModalViewControllerAnimated:YES];

Then you can pop to base view controller.

[self.navigationController popToRootViewController:YES];

Problem

Is there any way to quickly go to `rootViewController`? I want to remove all views from the stack & return to `rootViewController` without even bothering the sequence of views on top of it.

Original source