I have two UINavigationControllers like this:
LoginNavigationController -> LoginView
HomeNavigationController -> HomeView -> ...
From LoginView I navigate to HomeView modally like this:
[self presentViewController:HomeNavigationController animated:YES completion:nil];
When the app goes to background I use an observer in LoginView that dismisses HomeNavigationController.
There is a case though, in which I must present HomeNavigationController directly, without asking the user to login. I do this from another storyboard and reset my root view controller:
AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:kStoryMain bundle:nil];
UINavigationController *homeViewController = (UINavigationController *)[secondStoryboard instantiateViewControllerWithIdentifier:kControllerHomeNavigation];
appDelegate.window.rootViewController = homeViewController;
[appDelegate.window makeKeyAndVisible];
But when the app goes to background, I still must redirect to LoginView.
Is there a way to redirect to LoginNavigationController, add the observer and present modally the HomeNavigationController, and all this to happen seamlessly for the users, without them noticing that Login is being created? If not, should I somehow change my approach to the task?