0
votes

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:

  1. Launch app delegate
  2. Launch my series of view controllers
  3. 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;
}

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

2

2 Answers

1
votes

Why not put the tabbar hidden?

1
votes

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:

  1. [self.window bringSubviewToFront:self.splashView]; // on the top

  2. [self performSelector:@selector(removeSplashView) withObject:nil afterDelay:5]; // after 5s the splash will disappear automatically