So, we have two options:
Launch Screen Storyboard
Launch Images
I found out that 'Launch Screen Storyboard' option is the easiest and most efficient, but if you want rounded edges or borders on certain elements, you are constrained.
'Launch Images' gives you way more room for you to create static PNG's of your UI. However, they create more files and add to app size.
Apple Indicates: (here)
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary.
During run time, in real life, which is faster? Which makes app launch faster or easier on the system?
App Thinning
It depends on the amount of artwork you are displaying in the launch screen vs the image size in the launch image. Also techniques like app thinning will create the right variant for each device type to pick the right asset avoiding other which are not necessary.
Check out this link when you are using image assets
iOS is fast enough to load either storyboard or image. There's no need to worry at all, just do what's the most handy for you.
By the way, there's a third option:
Let iOS first show the static launch screen/image. Then show your first view controller having the exact same layout as your launch image but adding dynamic UI elements. This first view controller should be alpha animated in. Examples of added dynamic UI elements: loading progress bar, or Sign Up / Log In buttons.
Related
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
I have some issues with the launch screen images, when the app is started. I currently using the default image set that contains the #1,2,3x images, but I figured out that there is also an Launch Image Set. This will solve also the problem of different iPhone sizes with the export for multiple screen resolutions. But after uploaded the correct images to the launch image set, I can't select them within an UIImageView in the launch storyboard. Is this even possible and if so, how can I use that in storyboards? Or is there another way to do this?
I cycle through an x amount of images that will randomly display when opening the application. So every time you open the app, it will display another image.
You can't use launch images in the rest of your storyboards. You should create a normal image set to use in the rest of your app and use constraints to get it to adjust size to whatever device the app runs on.
The launch image is shown while your app is loading ("launched", loaded to memory). So you can not run any code at this time.
As the launch time is not that long, a common approach is to initially show a view, that looks 100% identical to the actual launch screen for 3 seconds or so. So you can do run code, animations or such there.
In my personal user experience this is an ugly approach, as you let the user wait for no reason but to show of you CI.
To sum it up: You can not have a random initial launch screen.
Find more information about how to actually setup a launch screen in this answer.
With the (relatively) new feature of iOS to have launch screens generated from a XIB file, a logical question arises: is it possible to reference any sort of dynamic resource from these XIBs? An example would be an app having customisable home screen, which makes it neccessary for the XIB file to adjust once the user changes smth (i.e. background color)?
Maybe it's possible to reference an image from Documents/ folder or read some dynamic plist file's values?
According to iOS Human interface guideline Launch file/image should be static.
Design a launch image that is identical to the first screen of the app, except for:
Text. The launch image is static, so any text you display in it won’t be localized.
UI elements that might change. If you include elements that might look different when the app
finishes launching, users can experience an unpleasant flash between
the launch image and the first app screen.
For more information see: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html
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.
I understand, Its a HIG violation to play around with the default launch icons and splash screens, but I have requirement such that, I need to display the splash screen only for the first time, Is it possible to implement it ?
One simple solution, I can think of is : displaying as an imageView on top of UIwindow and then removing it based on a timer. Am looking for other options.
My advice is to rework your view hierarchy so that the first view mimics the splash screen you wish to show (A view controller with a uiimage embedded should work fine for what you've described). Then push the "main screen" over top of that view after your specific period of time. A little code to ensure that this happens only on the first run with some persistent storage and you should be good to go.
I do not advise working with UIWindow directly. Doing so can lead to all sorts of headaches.
That is to simple.
But you aren't need to manipulate the launch image, but an image loaded by your app.
To prevent to launch the second time you can set a flag in the internal storage.
Make sure to use a lazy load / initalization technique and display the image fast as much is possible, than do the initializations.
I hope it helps!
If you use iOS6, you can use restoration feature.
At first run your app will show launch image. All other runs it'll show last state screenshot.
So you know its a HIG violation but looking for some workaround.
You have to have a launch image while uploading the app and showing on first launch.
I assume you dont care about app review in appstore.
Lets think
Launch image has to be in main bundle. And the main bundle is readonly for your code.
I have some workaround but it may work only for second time launch to show the launch image and then no again.
Add your launch image with any name
Add a symlink to your app bundle with name Default.png, which shows the file in 3. step
Copy that launch image to your app directory folder (your symlink in app bundle shows the file) on first launch.
Launch second time the app and see the launch image
Delete the copied image.
When your app can not find a png file which showed by your symlink it can not show launch image
PS: Personally I did not try that but may work.