0

I use a launchImage set to launch my app, instead of .xib. In AppDelegate.swift I set a NSThread.sleepForTimeInterval(2.0) to delay it, but when launchImage disappears, it doing so immediately. What I would is that my launchImage disappears with a fade out effect. Is it possible?

Thanks

Giuseppe
  • 165
  • 2
  • 10

1 Answers1

2

Strictly speaking, no, because you don't have control over how the OS uses the launch image.

But what you could do is make a dummy/replacement view of the same.

Upon launch, let the first UIViewController you load simply contain a UIImageView of the same launch image. You may have to do a little work to make it look right in your particular situation, for the interface orientation, etc. But if all goes right, when you load up this ViewController, you shouldn't notice a difference or any sort of transition between it and the actual launch instance -- visually it's all the same, tho technically it isn't.

Then you could have this view/image fade out. Essentially this gets the effect you want.

hsoi
  • 2,764
  • 3
  • 19
  • 20
  • Ok, thanks! Is possible to detect when iPhone 6 Plus is in landscape mode? – Giuseppe Apr 08 '15 at 10:13
  • There are 2 notions of orientation: UIDeviceOrientation and UIInterfaceOrientation. They are similar and related, but distinctly different. You will probably want to work with UIInterfaceOrientation. See things like UIApplication.statusBarOrientation – hsoi Apr 08 '15 at 10:22
  • You may also find it more appropriate to look at UIViewController methods and properties like supportedInterfaceOrientations and other such "view rotation" supports. Look through UIViewController.h for methods and properties dealing with rotate/rotation, etc. – hsoi Apr 08 '15 at 10:24
  • My problem is that i want to animante my launch screen. If I use LaunchImage set, everything works perfectly with all iPhone. But the launchImage is static. To create an animation, I created a new ViewController, and I setted it as a initial ViewController, so I deleted the launchImage set. So at start everything works, but now the problem is: how can I adjust my interface for every iPhone? – Giuseppe Apr 08 '15 at 10:30
  • Without knowing you specifics it's difficult for me to say. This is why I originally said you may have to do some work to make things look right. – hsoi Apr 08 '15 at 10:33