Displaying splash screen for longer than default seconds Displaying splash screen for longer than default seconds ios ios

Displaying splash screen for longer than default seconds


No, the default.png is shown while your app starts up.

You can add a new viewcontroller which will display the default.png in the application didFinishLoading.

This way you display the default.png a bit longer.

You should only show the default.png if you are loading data, which could take some time.As the appstore guidelines state, you should not delay starting of you are any longer than necessary.


You can also use NSThread:

[NSThread sleepForTimeInterval:(NSTimeInterval)];

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

For example, display default.png for 5 seconds.

- (void) applicationDidFinishLaunching:(UIApplication*)application{   [NSThread sleepForTimeInterval:5.0];}


This is super hacky. Don’t do this in production.


Add this to your application:didFinishLaunchingWithOptions::

Swift:

// Delay 1 secondRunLoop.current.run(until: Date(timeIntervalSinceNow: 1.0))

Objective C:

// Delay 1 second[[NSRunLoop currentRunLoop]runUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];