2

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?

Ketan
  • 123
  • 1
  • 1
  • 10

1 Answers1

9

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....
}
RckLN
  • 4,272
  • 4
  • 30
  • 34