I want to hide the launch image immediately, instead of fading it out. Is there a way to do this?
4 Answers
You can make an initial view controller with a UIImageView
that is identical to your launch image. Then you can specify whatever animation you want between the initial view controller and the first actual view controller in your app.

- 507
- 3
- 14
-
additionally you should make an effort make sure your app loads relatively quickly. this is achieved by assuring that your root view controller as lightweight as possible. – iksnae Feb 26 '14 at 02:41
The answer is fairly straight-forward, as others have said. As long as the UIView behind the launch image is identical in appearance, all you have to do is delay your custom transition by 100 ms (an unnoticeable delay to the user) so that the launch image can fade to 0 alpha.
double delayInSeconds = 0.1;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(){
// Do custom launch image transition
});
This works seamlessly!

- 18,087
- 14
- 64
- 91
Create view controller that contains UIImageView and then just use an NSTimer then change to main controller.

- 756
- 5
- 14
-
Why would you use an NSTimer? The question asked to hide the launch image "immediately"... there's no need for a delay. – David Schwartz Feb 26 '14 at 01:36
-
1Misread the question oops. I thought the launch image did just disappear as soon as the app had opened? Learnt something new haha. – Joey Clover Feb 26 '14 at 01:38
The launch image display time is depended on your app's implement, simpler launch shorter time. I can't tell in the end what factors affect the time. But you can't hide it immediately by yourself, what you can do is just to show some other animations, which must be based on the launch image then do all kinds of launch animations. No matter what kind of animation to make, it will cast more launch time, but make the launch featured.

- 2,768
- 1
- 15
- 20