Unpacking iOS 5 - return to the initial view controller

I am working on an application that uses the new storyboard feature in Xcode 4.2

Is there a way to programmatically send the user back to the source view controller from anywhere in the application?

For example, when a session expires and they need to log in again (the initial view controller is my login screen)

+6
source share
1 answer

I assume that you are using the UINavigationController . Then you can use the popToRootViewControllerAnimated: method. You must do this with this line:

 [self.navigationController popToRootViewControllerAnimated:NO]; // Put YES for animation. 

You can read more about the UINavigationController in docs .

+3
source

Source: https://habr.com/ru/post/902637/