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.