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.
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.
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.
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
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`
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With