Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch Screen that behaves exactly like Launch Image

Tags:

In order to get iPad Pro to use full resolution at launch, we have to use a Launch Screen File.

I've never used a Launch Screen XIB/Storyboard before, because my app is backwards compatible to iOS 7. Normally I use a LaunchImage asset catalog to define a specific static image for each device dimension and launch orientation.

Now I'm trying to define a Launch Screen File that acts like a LaunchImage asset catalog, but I'm struggling to do it. In particular:

1) I don't see a good way to select a different UIImage depending on the exact size of the device, e.g. show one image to iPhone 4S users and another image to iPhone 5 users.

2) I don't see a way to select a different UIImage for iPad Portrait and iPad Landscape views. Size classes seem to think that both iPad Portrait and iPad Landscape are "Regular" width and "Regular" height, so any UIImage that would show up on iPad Portrait will also show up in iPad Landscape.

like image 594
Dan Fabulich Avatar asked Nov 13 '15 20:11

Dan Fabulich


People also ask

What is difference between splash screen and launch screen?

Splash Screen is the very first screen the user sees when they open up an app on a mobile device. It's the very first chance of creating a positive impact on the users. It appears while the app is loading when the user has just opened up the app. Many times the Splash screen is called a launch screen.

What is LaunchScreen storyboard?

The LaunchScreen. storyboard is an interface builder storyboard file that uses auto-layout and some basic constraints on the controls to adjust the display for all the supported devices. Perform this task in the copy of the DeploymentKitApp in Xcode on your computer.

What is a launch screen?

In iOS, iPadOS, and tvOS, the system displays a launch screen the moment your app or game starts and quickly replaces it with your first screen, giving people the impression that your experience is fast and responsive.

What makes a good app launch screen design?

The colour scheme is taken straight from their logo and app icon, which effectively promotes their brand as you open the app. The light text on a dark but distinctive coloured background with a gradient stands out and draws the app user’s eyes towards the logo. Soompi: Soompi’s app launch screen is effective for a few reasons.

What do people want from an app Launch Experience?

People appreciate a streamlined launch experience so they can start using your app or game immediately. Provide a launch screen if the platform requires it.

What is the best K-pop app launch screen?

Soompi: Soompi’s app launch screen is effective for a few reasons. Firstly, the logo is clear and stands out against the dark background. The background is fun and animated, containing illustrations and text relating to the app contents (it’s a news app focused on the K-Pop industry).


2 Answers

The system loads the launch file before launching the app which creates some constraints on what it can contain (some of which may force you back to static image files):

1.The app is not yet loaded so the view hierarchy does not exist and the system can not call any custom view controller setup code you may have in the app (e.g. viewDidLoad)

2.You can only use standard UIKit classes so you can use UIView or UIViewController but not a custom subclass. If you try to set a custom class you will get an Illegal Configuration error in Xcode.

3.The launch file can only use basic UIKit views such as UIImageView and UILabel. You cannot use a UIWebView.

4.If you are using a storyboard you can specify multiple view controllers but there are again some limitations. For example you can embed view controllers in a navigation or tab bar controller but more complex container classes such as UISplitViewController do not work (at least not yet).

5.Localizing the launch file does not currently seem to have any effect. The base localization is always used so you will probably want to avoid text on the launch screen.

6.You cannot specify different launch files for iPad and iPhone. This may be a problem if you have significantly different interfaces for those devices as there is only so much you can do with auto layout and size classes.

Note that if you are deploying to iOS 7 you will still need to include the static launch image files. You can include both a launch image file and static launch images. Devices such as the iPhone 6 running iOS 8 will use the launch image file whilst iOS 7 devices will fallback to the launch images.

like image 135
Kusal Shrestha Avatar answered Oct 24 '22 14:10

Kusal Shrestha


  1. First create all your images. Then, open up your asset catalog and right click -> App Icons & Launch Images -> New iOS Launch Image. This will create an file to drag all your files into. Do that. Name the asset "Launch." enter image description here

  2. Create a new launch screen storyboard with command-n. Choose iOS -> User Interface -> Launch Screen. Call the file "Launch Screen."

  3. In your Launch Screen storyboard, select the view controller's view

[selecting the view.

  1. Find the UIImageView placeholder from the object library in the bottom corner of the right side ba, and drag it into the launch screen view.

UIImageView

  1. Now, select the image view in the storyboard, and type in the name of the image from your asset catalog.

enter image description here

  1. Control drag from the UIImageView to it's container view to set up auto layout constraints as follows :

enter image description here

  1. Optional... if you want it to look nice in your storyboard, select the view and do option-cmd-= to update the frame of the UIImageView.

  2. Go to your info.plist, and type the name of your storyboard ("Launch Screen") for the key "Launch screen interface file base name"

  3. Clean and run.

Hope that helps and that I didn't forget anything!

like image 29
olynoise Avatar answered Oct 24 '22 12:10

olynoise