Programmatically change splash screen in iOS? - ios

I am currently trying to figure out how to change the splash screen (default png) in iOS.
From what I understand, the ideal way to present an application to the user at the very beginning is to have the launch image a skeletal representation of the UI elements in the app (like this: http://h.dropcanvas.com/u90tr/IMG_0388.png).
Now, in my application, when I switch tabs and go to another app or the home screen, when I return to the application, the splash image is no longer relevant to that particular tab.
Ideally, what I would like to do is programmatically change the launch image in applicationDidEnterBackground so I can present a relevant splash screen when returning to the application.
Many thanks for your help!

You can't do this, and shouldn't need to bother. The launch image (it is NOT a splash screen!) is only used when your application is launched from scratch. If its just been into the background, the OS will take its own snapshot and use that when you return to the app.
Your launch image therefore only needs to show a basic representation of your app as it will appear when launched from scratch. If you have a tab bar, it shouldn't show any icons or labels (as they can change with localisation) - literally just the black glossy background, all the way across. In your link, I would lose the bar button item, for example.
If you can't make a representative image, a plain black image (or no image at all) would be best.

Related

iOS development - launch screens where image on main screen can change?

So I am new to iOS development and I have a question about the launch screen.
My app will have an image (that loads when the app opens from the internet) this can change anytime the image is updated on the website, so what is the done thing when designing a launch screen as the image could be different to what is on the launch screen?
Thanks
In Apple's Human Interface Guidelines, they suggest that the launch screen should match the first screen of your app. In the example they give, the only parts of the launch screen are the non-dynamic parts (the UI around the web content).
Design a launch screen that’s nearly identical to the first screen of your app. If you include elements that look different when the app finishes launching, people can experience an unpleasant flash between the launch screen and the first screen of the app.
The launch screen is presented before your app loads, and it should be used for static content only.
If there are any UI elements around the image that is displayed, show those in your launch screen. If not, choose a neutral background color that works well with the theme of your app.
Omit the image. A launch image should be a bare outline of what the screen will certainly contain. It might be no more than the correctly-colored background. It is just to cover the gap between nothing and something.
Read the Guidelines: https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/ Look at the picture on the left. That's a launch screen — basically empty.
LaunchScreen image is always the same..
You can set it in LaunchScreen.storyboard
The launch screen is used to display something whilst your app is initialising, making network requests or whatever.
You shouldn't be looking to load dynamic content here as if a user is on a very slow connection then they wont see anything until your image has loaded. This is why it doesn't have a view controller associated with it. it should be static.
You should only really be loading your logo or something in here, you could just use the company name. it will only show for a short amount of time. then when assets change, submit the changes to store

Prevent launch image overwriting of time on status bar

I read that Apple prefers the launch image to be similar to your initial app screen to provide the user with the illusion of "instant on", and that somehow the status bar of the app while loading is hidden so that there is no conflict in time.
I am using a screenshot of the app as my launch image.
However, the status bar is not hidden at loading. Instead, it is overwriting the image, which is okay for the static portion of the status bar which exactly matches the screenshot. However, the time of the status bar is superimposed on the time in the screenshot, creating a blur.
Is it best practice to remove the time from the screenshot in Photoshop, or is there a way to hide the status bar at launch? I've found suggestions to alter my plist file, but they seem a bit funky.
What is the best practice?
Launch image should not have the status bar on it because iOS actual status bar will be shown while the app is launching.
Also if you are using app screenshots, launch image should not contain any data or details that are shown to the user when the app is running.
Best practice is have something like a "background" that will be filled with actual data when the app is launched, giving the user the impression that the app launches faster.
See this example from Instagram app:

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.

I want no launch image but Apple is forcing me to have one

The purpose of launch images is to fake that the app is starting to give time to the app to fully load but I have this app of mine that is so fast to load that the launch image just is visible for less than 0.1 seconds. I have tested the app without the launch image and it loads fast than with a launch image.
When I submit the app to Apple without the launch image it fails validation.
This is ridiculous. Is there a way to solve that?
thanks.
The general rule of thumb is to use a launch image that looks like the first screen of your app with text removed, so it looks like a blank slate of your interface. Once your app starts rendering, it will be obvious to the user that it's reached that point.
Many times games will have a splash screen, especially since they sometimes load resources during that time. So those will usually either have a launch image that is their splash screen, where once rendering it starts it makes some animation occur, or they will sometimes start with a black launch image because the logo/splash will fade in.
As you said, the app fails validation without the launch image. Also when Apple first came out with the iPhone 5, the way you added support for the iPhone 5 screen size was by adding a launch image at that size. So in that case Apple is actually using the presence of the launch image to determine if you support the screen size or not. In other words, you need launch images, and it does help with the user experience, even if it is only visible for a split second.
There is no way to solve it - you must have a launch image.
You could use a launch image that looks a lot like your first page, so it doesn't look so jarring when it briefly flashes up.
Last I checked when you don't have a launch image for a debug build iOS uses a default image. If I remember right it is black. So you could create an all black image and use that.
Ive personally never used a launch image and have gotten all of my apps approved. Maybe you're failing validation because of something else?
you do not need a launch image. This is not causing you to fail validation

Launch image does not disappear upon initial app launch but does thereafter

I'm using Trigger.IO's toolkit to add the launch images. After doing so, the app fails to remove them from view after initially starting up the app. After hitting home and then going back to the app, the launch image disappears after launch.
The app isn't actually freezing after launch but just keeping the launch image at the forefront. I used a partially transparent image initially, and it appeared just to have a high z-index. I could use the app, but the launch image remained on screen over the top of everything.
As of platform version v1.4.20 you can control the launchimage visibility (http://docs.trigger.io/en/v1.4/release-notes.html#v1-4-20).
We've seen some instances of very early usage of the Forge APIs causing the launchimage not to show. In most cases, leaving the launchimage to hide itself manually is fine; if you're having problems or want more control over the launchimage, you can use forge.launchimage.hide.
Very odd, the problem seems to have dissipated even though I have not attempted to address it directly considering it was merely a config file change.
I'll report back if the problem surfaces again, but all is well currently!
Try add to use this code line
[window setRootViewController:mainController];
For full help, we need a some your codes

Resources