How to manually set which kind of storyboard to show in the delegate application

I have an application that wants to log out when the application is inactive for a certain period of time. These are several different views in the application, and I want the application delegate to set loginview as the current view whenever this method fires:

- (void)applicationDidBecomeActive:(UIApplication *)application 

How to manually set loginViewController as current displaying the view in the storyboard in this method?

+4
source share
1 answer
 UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]; LoginViewController *loginViewController = [mainStoryboard instantiateViewControllerWithIdentifier:@"LoginViewController"]; [_window setRootViewController:loginViewController]; 
+14
source

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


All Articles