Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

increase launch image time on xcode

for iOS devices, after set a custom launch time image, when tested on simulator it remains about 4s but when tested on iphone it is hide after less than 1s! Assumed that depends on processor but how to modify that visualization time?? Thanks.

like image 610
Ruth85 Avatar asked Aug 21 '11 07:08

Ruth85


People also ask

What is launch screen in Xcode?

The launch screen appears instantly when your app starts up and is quickly replaced with the app's first screen. You create a launch screen for your app in your Xcode project in one of two ways: Information property list. User interface file.


4 Answers

Better option would be to put a sleep of 5 seconds in your appDidFinishLaunching: method.

Statement at the start of your appDidFinishLaunching: method.

sleep(5);

Hope this helps you.

Note:- You may want to increase the time from 5 seconds to whatever time that is suitable for you. Thanks

EDIT: You may need to include #import <unistd.h> statement.

like image 198
Parth Bhatt Avatar answered Nov 15 '22 17:11

Parth Bhatt


Add the sleep function to your this method below in your delegate class.
NOTE: the name of the method is NOT the same as suggested in the answers above.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions  
    {

    sleep(3); //PUT THE SLEEP HERE AND IT WILL HOLD YOUR LAUNCH IMAGE FOR HOWEVER SECONDS YOU "SLEEP"

    // Override point for customization after application launch.

    return YES;

    }

This worked for me. This post is intended for future seekers to this problem not that I'm trying to answer a question that was asked 2 years ago

like image 23
Bori Oludemi Avatar answered Nov 15 '22 18:11

Bori Oludemi


We can also increase the duration time of App Launch Image by implement applicationShouldLaunch as below,

#import "MSTRMobileAppDelegate.h

@implementation MSTRMobileAppDelegate (Extension)

- (BOOL)applicationShouldLaunch:(UIApplication *)application errorDescription:(NSString**)errorString
{   
    sleep(10);

    return TRUE;
}

@end`
like image 29
Chuck Avatar answered Nov 15 '22 17:11

Chuck


You can't actually change of the loading time itself - that's decided by the operating system and how it takes to load. BUT - you can make it feel like it takes longer by simply putting a UIImageView with your image on top of your main window application and removing it using an NSTimer - you can even use nicer animations to make it disappear like make it fade out.

like image 25
shein Avatar answered Nov 15 '22 18:11

shein