How to launch view controllers before UITabBarController?
I have an app/game where I would like to display a series of view controllers (ie: Start game, load game, etc) before displaying any form of UITabBarController.
The process would be:
- Launch app delegate
- Launch my series of view controllers
- Only when Start game has been pressed launch/show the UITabBarController.
My UITabBarController is tied to the app delegate, and my current code is as such:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
SplashScreenVC *splashScreenVC = [[SplashScreenVC alloc] initWithNibName:@"SplashScreenVC" bundle:[NSBundle mainBundle]];
UINavigationController *firstView = [[UINavigationController alloc] init];
[firstView presentModalViewController:splashScreenVC animated:NO];
[firstView release];
[splashScreenVC release];
[self.window addSubview:[tabController view]];
return YES;
}
开发者_C百科
I try to launch the splash screen as a modal view controller, but this does not appear to work.
I've also tried launching it as initWithRootViewController
-- but regardless what I do the UITabBar still gets launched and I never see the modal view.
So, how do I launch stuff, views, etc before the tabBarController view?
Many thanks
Why not put the tabbar hidden?
Do you know the iOS responder chain ? If you want to show the UI , the UI must be added on the window . so the splash should be added on the window( the first index on top just "tabbar hidden"), you will see the display effect, then after showing Splash , you will see the normal tabbar.
note:
[self.window bringSubviewToFront:self.splashView];
// on the top[self performSelector:@selector(removeSplashView) withObject:nil afterDelay:5];
// after 5s the splash will disappear automatically
精彩评论