Displaying iOS LaunchScreen for longer time - ios

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.

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.

Related

iOS: Update launch screen dynamically

I've designed a launch screen using story board. It's supposed to have 3 images. 2 of these are static, where as, i need to update one at run time (after downloading that from server).
My understanding is that we can not add code for launch screen as there is no controller for this at backend.
What i want to do is to use some default place-holder for the first time. Download & cache that dynamic image at some other point in application. And when user use the app for the 2nd time, show the cached image.
Any solution? Can i update xcassets at run time? Or can i update the image using keypath?
Update:
Just found that launch screen and splash screen are 2 different things (Link). Adding content in launch screen dynamically is not possible. Whereas, using splash screen (without any need) is not recommended.
This is not possible, the story board used at launch time is in the main bundle of the application which is readonly and can not be changed.
Also you (edit) can't run any code on startup, since your app is not running.

What is the difference between launchscreen.storyboard and main.storyboard

I googled the two word together but could not find anything. I have never used it. Is there any necessity for it although we have main.storyboard.
They are two completely different things. The launch screen is what first appears when the user taps the app icon before the app is finished launching. It shows a single, static screen. It can't be dynamic and it can't use any custom classes or code. It's the replacement for launch images.
The main storyboard is what your app actually displays when the app is running. It contains your app, code, and logic.
When you run your program in Xcode simulator gets open and your application gets open then you can see black white screen for fews seconds before actuals developed screen
Blank screen - LaunchScreen.storyboard - Non editable
Developed Screen - Main.storyboard - Editable for which you can able to make changes
The launchscreen.storyboard (basically a loading screen) is what comes up when the user loads the application. How long it appears to the user depends on how long it takes for the user to load your application. You can change the duration of the launchscreen.storyboard but it is not recommended, generally users want the app to load as fast as possible
The main.storyboard is appears onto the screen AFTER the launchscreen.storyboard
When the app is being running in the Simulator/iPhone the 1st screen which is loaded in the memory after the user click the app icon is LAUNCHSCREEN.STORYBOARD and after the app is fully loaded, this is the time where MAIN.STORYBOARD comes into play, this is the screen which is editable you can add actions, outlets , other screen inside a View Controller, so the main work is being done inside MAIN.STORYBOARD and LAUNCHSCREEN.STORYBOARD is being used to display something static while the app gets fully loaded.

iOS Launch Screen Image not always showing

I use a Launch Screen (xib) in my app to overcome the problem of the resizeable screen, since i don't always want add Launchscreens everytime, Apple create a new iPhone with a different screen resolution.
In my launchscreen, i placed a UIImageView directly in the center of the view using constraints. The image shows the logo of the company i work for.
The problem is, that sometimes the image is being hidden (mostly after install and first launch) and sometimes it shows (mostly after a view times using it). I'm not quite sure, what the problem is. Is it because at the first-launch-time(s) it has to load many ressources?
Figured out the problem: It seems, that if there isn't enough disc space left on the device, it doesn't show the xib's (Launch-Screen's) Image. iOS at some point clears out some disc-space (i guess from NSLibraryDirectory) and than the images show again.
If this is a major problem to any of your apps, use Launch-Images instead.

iPhone SDK - possible to have multiple splash screens?

I'm making an app with a different screen for its first run. Once it has completed its first run, this screen is never shown again. The issue I have is that my launch image is built to look like the view that the user sees every other time they run the app, so at first run the loading screen looks weird. Is there any way to have one loading screen for first run and one loading screen for other runs? Thanks
You cannot have multiple or dynamic launch images. Even with the new storyboard/nib launch files, they are still quite static.
Make sure to open an enhancement report with Apple, requesting this feature.
In the meantime, consider a slight change of your flow to first display the initial view, and have an animation to display your first-launch view. This way, the transition will be smoother and more natural to your users.

Can we use the sequences of 3 launch images in iphone/ipad

Can we use the sequences of 3 launch images in iphone/ipad?
No. A launch image is just one image (for that particular device/scale/orientation).
We show an animation in one of our apps, which starts immediately after launch (on the root view controller).
Technically not. But you can show additional images yourself after the app finished loading. The Default.png is used to display something (instead of a black screen) while your app loads.
Once it finished loading, it is immediately replaced with your main window's content. Then you can add UIImageViews or UIViewControllers to display anything you would like. But at this point your app is done loading and it would be a waste of time to show anything else, than your app's live content.
You cannot use sequence of images in default launch.
But you can do with the customise the code on view to change the images sequentially with a timing difference once the default image is loaded.
No. you can use only one image of different type of device like normal size,3.5 inch and 4 inch
You can add a new viewcontroller which will display the different type of splash screen image in the application didFinishLoading.
This way you display the more splash screen display a bit longer.

Resources