iosswiftxcodelaunchimage

For iOS LaunchImage, do I need all images?


If using launch image asset do I need to specify all the images if my app is only in portrait mode and only for iPhone? I.e. do I need the landscape images or the iPad images or will it work without them?


Solution

  • If your app is only in portrait mode and only for iPhone, then no you don't.

    I would suggest using Storyboards instead of launch images. Here is how you could do so:

    This is how:

    1. Create a blank storyboard file named for example MyLaunchScreen.storyboard.

    2. Click on your project and go to your Target Settings and, on the General tab, select the storyboard as your Launch Screen File. Xcode will then add a corresponding UILaunchStoryboardName key to your app’s Info.plist. When this key is present, Xcode will prioritize it over any launch images you might have set.

    3. Add a view controller scene to the storyboard, add UIImageViews or whatever you like. Adding some constraints will make this storyboard work on all devices without having to set images for all devices.

    If you still do want to use images, here is how:

    a. Click on the project target, in the General tab, set the Launch images source to be an image asset

    launch images

    b. In the launchImage image set, toggle the attributes inspector and set the device classes that you'd like to add launch images for. In your case just the iPhone portrait checkbox should be selected:

    launch image options