Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 336
Ketan Avatar asked Feb 14 '26 15:02

Ketan


1 Answers

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....
}
like image 58
RckLN Avatar answered Feb 17 '26 10:02

RckLN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!