Reputation: 5267
As with ios4 i can create my custom view for showing as splash screen and can set rootViewController in appdelegate file using xib
but
with iOS 5 with UIStoryBoard how to set or change default UIStoryBoard to first show the Splash Screen and then the required view in my app it is one navigation controller
Please help me with this Thanks in advance
Happy Coding :)
Upvotes: 0
Views: 401
Reputation: 2444
Another solution would be to present a modal view controller like that:
- (void)applicationDidBecomeActive:(UIApplication*)application
{
static dispatch_once_t onceToken;
dispatch_once( &onceToken, ^
{
SomeLaunchViewController* launchViewController = [[SomeLaunchViewController alloc] init];
[self.window.rootViewController presentViewController:launchViewController animated:NO completion:NULL];
} );
}
Presenting the view controller modally in -application:didFinishLaunchingWithOptions:
didn't work for me — the 'UIStoryboard' mechanism seems to be not yet finished at that time.
Using dispatch_once
ensures that the modal launch screen will only show up once and not every time the application becomes active from being in a background state.
This example uses ARC.
Upvotes: 3
Reputation: 5267
Got solution through some research have to use performSegueWithIdentifier:sender:
and problem is solved.
No requirement to use any other UIStoryBoard
just have to put required UINavigationController
and it's work like charm
thanks to GOOGLE and Apple
Happy Coding :)
Upvotes: 0