How can I display a splash screen for a longer period of time than the default time on an iPhone?
24 Answers
Read the Apple iPhone Human Interface Guidelines (HIG). The "splash screen" isn't supposed to be for branding or displaying a logo, it's supposed to look like the default condition of the app so it appears to start up quickly.
Making it stay there for longer would be a violation of the HIG.

- 179,021
- 58
- 319
- 408
-
108This doesn't answer the question at all. The questions asked is "how?", not "should I?". – korona Feb 16 '09 at 14:05
-
71Sometimes "don't do it" is the best answer to "how". – Paul Tomblin Feb 16 '09 at 14:07
-
18For reference I do agree that you shouldn't do this, but I still disagree with this way of answering. I'll agree to disagree ;) – korona Feb 16 '09 at 15:27
-
2So, @korona, how *do* you tell somebody that what they're asking how to do is something that they really, really shouldn't do other than answering the question? – Paul Tomblin Feb 16 '09 at 15:37
-
33@Paul Tomblin: I understand your point, but it really is beside the point. I think a friendly warning coupled with a "However, if you really want to do this, ..." response might be the best approach. Thoughts? – CIFilter May 05 '09 at 14:42
-
2No, it's not besides the point. If the question was "Where do you hide your house keys because I want to steal your stuff", would you chide me if my answer was "Don't do that!" instead of "a friendly warning coupled with a 'However..."? – Paul Tomblin May 05 '09 at 15:02
-
3Nope, sorry Paul, the question is "how". – Justicle Sep 03 '09 at 04:17
-
1Justicle, how can I kick you to inflict the most pain? Keep in mind that telling me not to do it isn't answering the question. – Paul Tomblin Sep 03 '09 at 12:35
-
12Thankfully there were useful answers below. Yes, I understand the joy of feeling like a righteous purist -- but the New York Times application does something like this, and it's a wonderful way to start that app. It leads to more user delight, not less. The Apple police didn't reject that app because they know they don't have the answer to every situation -- they leave it to us developers to get creative. – Vineel Shah Feb 16 '10 at 02:46
-
4@Paul Tomblin, I find that the Default.png snaps to my first view in an ugly, jerk-like manner. If I want that transition to say, fade in, then You need something like what @Ben described. Or perhaps the app needs to continue to download information after loading, and wants the user to wait just a bit more. There are lots of reasons to do this without violating the word or spirit of the HIG. – Stephen Furlani Nov 17 '10 at 14:28
-
I think this better suits as a comment as you can just suggest him.And this not at all answers the question. See jimiHendrix correct answer – DD_ Feb 21 '13 at 05:58
-
1@PaulTomblin Not all the applications are supposed to be published in AppStore. So sticking to HIG is not always mandatory. I'm developing an enterprise app, so I've to stick to what ever employer want, and they want to show the splash screen with sponsor logos until user taps the screen or disappears after 2 seconds. So your answer is not the correct answer. – Hadi Sharghi Jan 10 '15 at 05:02
-
"don't do it" was not what he asked for. If "don't do it" is the only thing you know just don´t answer. – Ronald Hofmann Mar 02 '15 at 05:02
-
@RonaldHofmann how do I kick you so as to inflict the most pain? If "don't do it" is the only thing you know, then just don't answer. – Paul Tomblin Mar 02 '15 at 12:48
-
1@PaulTomblin - The problem with your analogy is the weirdness of your comparison of violating an individual's inalienable rights to - a guideline?? – Adrian Bartholomew Jan 23 '16 at 23:24
The simplest way to do this is to create a UIImageView who's image is your Default.png. In your applicationDidFinishLaunching: method, add that image view to your window, and hide it when you'd like your splash screen to go away.

- 85,404
- 22
- 176
- 172
-
1I just wonder why everyone says exactly "Default.png". What is the point? – efeyc Nov 15 '11 at 07:52
-
15Because apple recognize default image by default if its name is default.png – Chatar Veer Suthar Nov 24 '11 at 16:49
I needed to do this to block showing a table view until the data was loaded over the network. I used a variation of one I found here:
http://michael.burford.net/2008/11/fading-defaultpng-when-iphone-app.html
In the interface of your App Delegate:
@interface AppDelegate : NSObject
{
UIImageView *splashView;
}
In the implementation:
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// After this line: [window addSubview:tabBarController.view];
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
// Do your time consuming setup
[splashView removeFromSuperview];
[splashView release];
}
Make sure you have a Default.png in the resources

- 112,709
- 45
- 203
- 241
in your appDelegate , theres a method called applicationDidFinishedLaunching use a sleep function. Pass a digit in the sleep function for the no. of seconds you want to hold screen.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[window makeKeyAndVisible];
[window addSubview:viewController.view];
sleep(5);
return YES;
}
I searched so much for this thing and everybody gave their own complex point of view. I couldn't find a simple way that would just let me do it.
KISS ( Keep it simple and Smart :) I avoided the actual as its offensive.

- 2,778
- 6
- 39
- 57
-
1This blocks the main thread and if you are listening for listening for any notifications and some other network related stuff, it will not receive those. See my answer for a beter approach. – Ankit Srivastava Oct 04 '12 at 10:18
-
Best and simple way in my opinion, even from the memory side. Should be the right answer to this [old] question – Aluminum May 28 '13 at 16:18
-
Agree with Ankit, sleeping on the main thread is almost never a good thing. – Mike May 15 '14 at 13:50
-
1I'm sorry, but blocking the main thread with a sleep() is a horrible idea. As you effectively halted the main runloop, all UI related code, major parts of the event processing and every delegate call that gets dispatched to the main queue, you are pretty much locking up your whole application for 5 seconds. Display a progress indicator & dispatch your work to a background queue with a completion block that unlocks the UI when that work has finished. – mvanallen Sep 06 '16 at 14:47
Even though it is against the guidelines but if you still want to do this than a better approach rather than sleeping thread will be
//Extend the splash screen for 3 seconds.
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:3]];
this way the main thread is not blocked and if it is listening for any notifications and some other network related stuff, it still carries on.
UPDATE FOR SWIFT:
NSRunLoop.currentRunLoop().runUntilDate(NSDate(timeIntervalSinceNow:3))

- 12,347
- 11
- 63
- 115
-
1can you tell how to implement this in swift. I searched for 2 hours. still not able to figure it out. – Sarthak Majithia Jan 23 '15 at 09:07
-
I did it pretty simply, by having my rootViewController push a modalViewController, loading from "Splash.nib" in a subclass of UIViewController I called "SplashViewController". The exact call was:
- (void) viewDidLoad {
SplashViewController *splashScreen = [[[SplashViewController alloc]
initWithNibName:@"SplashViewController" bundle:nil] autorelease];
[self presentModalViewController:splashScreen animated:NO];
//continue loading while MVC is over top...
When you launch the app, it pops right up, like a splash screen should. Then, the SplashViewController nib is just a full-screen UIImageView with a splash png, 320x480. After a 1-second NSTimer (anything more did seem to get in the way), it fires timerFireMethod, a custom method that just calls
[self dismissModalViewControllerAnimated:YES];
Then the modal VC just slides down and away, leaving my top tableView. The nice thing is, while the MVC is up, the underlying table can continue to load due to the independent nature of modal view controllers. So, I don't think this violates the HIGs, and actually does allow for faster launching. What would you rather look at, a cute picture, or an empty default view (snore)?

- 171,072
- 38
- 269
- 275

- 169
- 1
- 3
-
this saved me a huge amount of work! thanks for the killer answer! – Toran Billups Feb 22 '11 at 00:14
-
This is also a great way to display an authentication screen that mimics the default splash screen. – IanStallings Jul 07 '11 at 15:30
-
this is the best answer on this page, strange to see the other rubbish answer got more than 25 votes at present . – DD_ Feb 21 '13 at 05:57
Yes, the simplest way is (remember to add your 'default.png' to targets -> [yourProjectName]: launch images in 'xCode'):
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[NSThread sleepForTimeInterval:3.0];
}

- 29,987
- 31
- 114
- 156

- 1,760
- 16
- 21
simply use sleep(time in seconds); in your applicationDidFinishedLaunching method

- 28,260
- 49
- 182
- 256
Make your app take longer to load.
In all seriousness, Paul Tomblin is correct that this usually isn't a good idea. Default.png is a mechanism intended to make your app appear to load faster by holding an "empty" screenshot. Using it for a splash screen is a minor abuse, but intentionally making that splash screen appear for longer than it needs to is almost sick. (It will also degrade your user experience. Remember, every second the splash screen is visible is a second that the user is impatiently staring at your logo, swearing they'll switch to the first decent competitor they can find.)
If you're trying to cover for some sort of secondary loading--for example, if the interface has loaded and you're just waiting to get some data from the network--then it's probably okay, and Ben Gottlieb's approach is fine. I'd suggest adding a progress bar or spinner to make it clear to the user that something really is going on.

- 17,541
- 7
- 56
- 91
-
3I don't agree that intentionally delaying the loading of the app for branding is necessarily "sick." Keeping a logo up there for 1 extra second, for example, seems entirely appropriate. However, it would be a bit ridiculous to delay the app for an significant amount of time just for branding purposes. – CIFilter May 05 '09 at 14:44
Here is my simple splash screen code. 'splashView' is an outlet for a view that contains an image logo, UIActivityIndicator, and a "Load.." label (added to my 'MainWIndow.xib' in IB). The activity indicator is set to 'animating' in IB, I then spawn a separate thread to load the data. When done, I remove the splashView and add my normal application view:
-(void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:splashView];
[NSThread detachNewThreadSelector:@selector(getInitialData:)
toTarget:self withObject:nil];
}
-(void)getInitialData:(id)obj {
[NSThread sleepForTimeInterval:3.0]; // simulate waiting for server response
[splashView removeFromSuperview];
[window addSubview:tabBarController.view];
}

- 10,089
- 6
- 61
- 69
Inside your AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Sleep is code to stop the slash screen for 5MoreSeconds
sleep(5);
[self initializeStoryBoardBasedOnScreenSize];
return YES;
}
//VKJ

- 7,696
- 1
- 50
- 51
In Xcode 6.3, you can show the launch screen.xib and even put a indicator on it, first it will show the default launch screen it is replaced by the nib so the user doesn't know it changed and then if everything is loaded hide it :-)
func showLaunchScreen() {
// show launchscreen
launchView = NSBundle.mainBundle().loadNibNamed("LaunchScreen", owner: self, options: nil)[0] as! UIView
launchView.frame = self.view.bounds;
self.view.addSubview(launchView)
// show indicator
launchScreenIndicator = UIActivityIndicatorView(frame: CGRectMake(0, 0, 50, 50)) as UIActivityIndicatorView
launchScreenIndicator.center = CGPointMake(self.view.center.x, self.view.center.y+100)
launchScreenIndicator.hidesWhenStopped = true
launchScreenIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray
launchView.addSubview(launchScreenIndicator)
self.view.addSubview(launchView)
launchScreenIndicator.startAnimating()
self.navigationController?.setNavigationBarHidden(self.navigationController?.navigationBarHidden == false, animated: true) //or animated: false
}
func removeLaunchScreen() {
println("remove launchscreen")
self.launchView.removeFromSuperview()
self.launchScreenIndicator.stopAnimating()
self.navigationController?.setNavigationBarHidden(false, animated: true)
}

- 495
- 1
- 6
- 22
just make the window sleep for some seconds in applicationDidFininshLaunchings method
example: sleep(3)

- 619
- 7
- 26
According to the Apple HIG you should not do that. But if your application needs to do so for definite purpose, you can do:
- import <unistd.h> in your AppDelegate.m
Write the following line at the first of the "application didFinishLaunchingWithOptions:" method
sleep(//your time in sec goes here//)
;
I have done this as below:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"splashView"];
self.window.rootViewController = viewController;
Note: LaunchScreen is the launch story borad and splashView is the storyboardIdentifier

- 106
- 3
The simplest way is to put your application's main thread into a sleep mode for desired period of time. Provided that "Default.png" exists in your application's bundle it will be displayed for as long as the main thread is asleep:
-(void)applicationDidFinishLaunching:(UIApplication *)application {
[NSThread sleepForTimeInterval:5];
window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
[window setBackgroundColor:[UIColor yellowColor]];
[window makeKeyAndVisible];
}
As you are already aware, it's a horribly bad idea to do but it should work just fine...

- 27
- 1
-
This blocks the main thread and if you are listening for listening for any notifications and some other network related stuff, it will not receive those. See my answer for a beter approach. – Ankit Srivastava Oct 04 '12 at 10:18
Write an actual splash screen class.
Here's a freely usable splash screen that I recently posted in my iPhone in Action blog: http://iphoneinaction.manning.com/iphone_in_action/2009/03/creating-a-splash-screen-part-one.html

- 786
- 5
- 17
For stylish splash screen tutorial check out this http://adeem.me/blog/2009/06/22/creating-splash-screen-tutorial-for-iphone/

- 193
- 3
- 9
I agree it can make sense to have a splash screen when an app starts - especially if it needs to get some data from a web site first.
As far as following Apple HIG - take a look at the (MobileMe) iDisk app; until you register your member details the app shows a typical uitableview Default.png before very quickly showing a fullscreen view.

- 6,672
- 3
- 38
- 46
What I did is presented a modalview controller in the initial screen and then dissmiss it after several seconds
- (void)viewDidLoad
{
[super viewDidLoad];
....
saSplash = [storyboard instantiateViewControllerWithIdentifier:@"SASplashViewController"];
saSplash.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController: saSplash animated:NO];
}
-(void) dismissSASplash {
[saSplash dismissModalViewControllerAnimated:NO];
}

- 1
- 1
There are many options already posted here, but I ran into cocoapod today that allows you to display the contents of your LaunchScreen.xib
as the initial view controller:
https://github.com/granoff/LaunchScreen (Also see this blog post from the author with more implementation details.)
This seems like a fairly straight-forward way to do this, and better than the vast majority of answers posted here. (Of course it wasn't possible until the introduction of LaunchScreen
files in the first place.) It is possible to display an activity indicator (or anything else you want) on top of the view.
As for why you would want to do this, I'm surprised that no one has mentioned that there are often publisher and/or partner requirements around this sort of thing. It's VERY common in games, but advertising-funded applications as well.
Also note that this does act counter to the HIG, but then so does waiting to load any content after your application launches. Remember that the HIG are guidelines, and not requirements.
One final note: It's my personal opinion, that any time an initial screen like this is implemented, you should be able to tap to dismiss it.

- 3,570
- 29
- 42
Swift 2.0
Use following line in didFinishLaunchingWithOptions: delegate method:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
NSThread.sleepForTimeInterval(5.0)
return true
}
But I recommend this:
Put your image in a UIImageView full screen as a subview on the top of your main view thus covering your other UI. Set a timer to remove it after some seconds (possibly with effects) now showing your application.
import UIKit
class ViewController: UIViewController
{
var splashScreen:UIImageView!
override func viewDidLoad()
{
super.viewDidLoad()
self.splashScreen = UIImageView(frame: self.view.frame)
self.splashScreen.image = UIImage(named: "Logo.png")
self.view.addSubview(self.splashScreen)
var removeSplashScreen = NSTimer.scheduledTimerWithTimeInterval(3.0, target: self, selector: "removeSplashImage", userInfo: nil, repeats: false)
}
func removeSplashImage()
{
self.splashScreen.removeFromSuperview()
}
}

- 1
- 1

- 14,148
- 92
- 64
There is default image (default.png) is shown when you start your app.
So you can add a new viewcontroller which will display the that default image in the application didFinishLoading.
So by this logic you display the default image for a bit longer.

- 149
- 1
- 7
Swift version:
Add this line in the AppDelegate
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
NSThread.sleepForTimeInterval(2.0)//in seconds
return true
}

- 1,513
- 20
- 27