Ruth85
Ruth85

Reputation: 745

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.

Upvotes: 20

Views: 22477

Answers (4)

Parth Bhatt
Parth Bhatt

Reputation: 19469

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.

Upvotes: 43

shein
shein

Reputation: 1844

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.

Upvotes: 5

Chuck
Chuck

Reputation: 61

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`

Upvotes: 5

Bori Oludemi
Bori Oludemi

Reputation: 63

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

Upvotes: 2

Related Questions