Is it be possible to return to the first view of a NavigationController?
Example:
View 1 -> View 2 -> View 3 -> (An action is performed) Return to View 1
Is it be possible to return to the first view of a NavigationController?
Example:
View 1 -> View 2 -> View 3 -> (An action is performed) Return to View 1
UINavigationController
is organized in a stack-like fashion, and it holds UIViewController
instances, not views. If you want to return to a previous ViewController, you would typically use the popToViewController method. Calling this method pops view controllers until the specified view controller is at the top of the navigation stack. In the example that you give in your question, you would do
[navController popToViewController: viewController1 animated: NO];