2

I am trying to set time for the launchscreen.xib to make it last longer, for example 5 sec,since by default it disappears too quick i searched the web but found nothing useful, can it be done ? Thanks

jack
  • 155
  • 5
  • 14

3 Answers3

3

The apple documentation mentions this:

A launch file or image provides a simple placeholder image that iOS displays when your app starts up. The placeholder image gives users the impression that your app is fast and responsive because it appears instantly and is quickly replaced by the first screen of your app.

So essentially the launch screen cannot be made last longer because its only displayed when the app is starting up.

Still if you want you can

  • create a custom UIView with the launch image
  • make it the Initial View Controller by dropping the arrow in storyboard to your custom UIView
  • present your main View Controller on top of the launch image view after x seconds using dispatch_after
Community
  • 1
  • 1
asifmohd
  • 921
  • 7
  • 16
2

You can add this in your app delegate:

float delay =5.0;

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    [NSThread sleepForTimeInterval:delay];

}
Popeye
  • 11,839
  • 9
  • 58
  • 91
0

If you use a viewController, you can present it again in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

making it the UIWindow's rootViewController, or presenting it modally from your application in the same method. This way, you can customize its dismissal. You can also add some animation to this viewController So it may be another viewController than your launchScreen.

Vinzzz
  • 11,746
  • 5
  • 36
  • 42