Depending on how big your app is, your splashscreen may come and go before the user has a change to see it in all its splashy goodness. Here’s a simple way to keep it on-screen a bit longer, even if you have tab controllers, navigation controllers, etc on your initial screen.
Just before your [self.window makeKeyAndVisible] call in your app delegate’s didFinishLaunchingWithOptions function, add the following code (changing the Default.png filename to your app’s splash screen png):
UIImageView *ssIV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]]; ssIV.userInteractionEnabled = YES; [self.navController.view addSubview:ssIV]; [ssIV release]; [self performSelector:@selector(removeSplashScreen:) withObject:ssIV afterDelay:5.0];
Also add the removeSplashScreen: selector to remove it after the 5 second delay:
- (void)removeSplashScreen:(UIImageView *)ssIV { [ssIV removeFromSuperview]; }
The code is pretty basic, but what you’re essentially doing is creating a UIImageView and covering your original UI with it, making sure that it doesn’t let any touches go through to the original UI. After the 5 second delay, it removes the view, and your original UI appears.