Search code examples
xcodexcode6delaysplash-screenlaunch-screen

xcode 6 - change default launch screen display time


In a new Xcode 6 project, a default LaunchScreen.xib file is created that is displayed for a brief time when the app starts. How can I alter the time of the display e.g. display it for 5 seconds?


Solution

  • You can also use NSThread:

     [NSThread sleepForTimeInterval:(NSTimeInterval)];
    

    You can put this code in to first line of applicationDidFinishLaunching method.

    For example, display screen for 4 seconds.

    File: AppDelegate.m

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
      /*this will pause main thread for x interval seconds. 
      put on the top of application:didFinishLaunchingWithOptions, so it will not 
      proceed to show window until sleep interval is finished.*/
    
        [NSThread sleepForTimeInterval:4]; //add 4 seconds longer.
       //other code....
    }