It seems like it should be simple, but it has a lot of complex nuances - and I did not find an answer elsewhere on Stack Overflow that answers this completely, clearly, and simply.
In a nutshell: I have an iPad app that uses storyboards to compose an application stream and a split view controller as the primary root view controller.
This application checks at startup if login credentials are stored, and if they jump directly to the user interface, and if not, it presents a full-screen login page.
The problem though is - where should this conditional check be performed and how should the login screen be instantiated?
I tried every permutation that I can think of.
In the application, the delegate seems like an obvious place, but the call to segues or modal pop-ups seems to be ignored, because the views from the storyboard do not yet live.
In the launch methods for a part controller with a split view, visibility appears to be the next obvious place.
The closest to working solution that I can find is described here:
https://stackoverflow.com/a/416829/
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"Login"];
[vc setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentModalViewController:vc animated:NO];
}
But with this implementation, called up by the split view view controller, a brief view of the screen is displayed briefly on the screen.
viewDidAppear viewWillAppear, , , .
, , , , , , .
- ? ?