I’ve set my launch screen to only display for 1 second using the code below sleep(1); in the app delegate, but when testing directly on a device, I have to wait for the full 5 seconds.
Every time I run a test using an iPhone, or an iPad, I have to wait the full 5 second default before the app will load, however, it works great in the simulator.
If I unplug the iPhone cable, the sleep() function works on the devices. Is there a setting in xCode for this?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
sleep(1);
...
}
In order to delay the launch screen this is not the recommended method. This just delays the whole process.
I recommend you add a new
viewControllerto the very beginning of your project which will show immediately after the launch screen with aUIImageViewcontaining the exact same image as the launch Image.Then add a delay from there before switching to the original first screen. This way you can even add a new different kind of transition to the launch image.