0

Some time ago we decided to put our application-loading logic into a separate function that is called after DidFinishLaunching. We are doing by showing a new UIViewController that contains the default splash image (as described here). The two reasons for this are:

  • We can automatically show the current version number on the splash screen.
  • If the loading time takes more than around 10 - 15 seconds, the app would be killed by the OS. We had this situation one time during a version update until now where a large DB / file reorganisation took up to 15 seconds. If the app would have been killed by the OS, the data would have been left in a corrupted state.

This worked fine. Now since iOS 8 things have changed a little bit and we are supposed to be using a launch screen xib or story board. I tried to load the xib in a UIViewController (our own splash screen), but this resulted in an NSInternalInconsistencyException - loaded the "" nib but the view outlet was not set. As I found out, launch screens must be pure static, same as the original launch images.

I like the concept of having only one launch screen instead of a dozen launch images. How would I be doing this? Is there a way to programmatically load the original launch screen xib and show it in my own splash screen view controller? Of course I would then also like to programmatically add the version number as I did it until now.

Edit: Putting the application to sleep in DidFinishLaunching() is not an option, see second point above.

Community
  • 1
  • 1
Philipp
  • 61
  • 6
  • 1
    its better you display a `viewcontroller` at the launch as `splash screen`, you can keep it on screen as long as you wish. There is no other way you can hold launch screen for longer period. – Dipen Panchasara Sep 15 '15 at 12:28
  • i hope given answer is helpful to you @Philipp. – Dipen Panchasara Sep 15 '15 at 12:45
  • Maybe show a loading animation? – Filip Radelic Sep 15 '15 at 13:15
  • @Dipen: That is exactly what I am trying to achieve. It's just that I would like to have the original LaunchScreen.xib loaded in my own view controller which is obviously not possible since the when a xib is marked as "Use as launch screen", it can not have any outlets (which would be needed to load the xib in a view controller). – Philipp Sep 15 '15 at 13:31

1 Answers1

-1

You can't hold launch screen for longer period.

You can add a ViewController with default.png in the applicationdidFinishLoading. Show this controller for few seconds(5 secs) and replace with next view controller.

Note: According to the appstore guidelines state, you should not delay starting of you are any longer than necessary.

Tejas Ardeshna
  • 4,343
  • 2
  • 20
  • 39
Dipen Panchasara
  • 13,480
  • 5
  • 47
  • 57