In my storyboard, I have two UIViewControllers. The initial view controller is a loading/splash screen that shows a simple image. The second view controller is a UIWebView.
I am trying to replace the loading view controller with the UIWebView view controller after the app fully loads.
Inside my loading view controller, I have this code to present the UIWebView:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"WebView"];
[self presentViewController:viewController animated:NO completion:^(void){}];
However, this code throws the following error:
Warning: Attempt to present <WebController: 0x145617960> on <LoadingController: 0x145610c40> whose view is not in the window hierarchy!
Am I doing something wrong?
Thanks for any help/suggestions.