iosiphoneimagelaunchimage

How do you set up 'image sets' to match launchImage files for all devices?


NOTE: This question is NOT related to launch image storyboards.

INFO: BG Buddy is a landscape only app. The launch screen uses images in a launchImage.xcassets file.

BG Buddy Background image set

The launch image transitions to a UIViewController containing a full screen UIImageView with the same BG Buddy Background image as used in the launch image, and some textual UIButtons. This gives the impression that the buttons appear on top of the background image after a short time when the app has loaded.

Here is how the BG Buddy Background image set has been set up since the app’s release. Transitions from Launch Image to UIViewController work perfectly on iPad, iPhones 5,6,7,8 and 6,7,8 Plus.

launchImage.xcassets file settings

iPhone SE sized launch image

iPhone SE sized  UIViewController

The iPhone X and the iPhone Plus both seem to use the iPhone 3x image slot but both have very different dimensions. I’ve opened up the other size classes slots and tried to find a place with much confusion and no success. NOTE: All iPhones apart from the iPhone Plus use compact width/compact height size classes when in landscape. The iPhone Plus uses regular width/ compact height in landscape orientation.

So how do you set up 'image set' files to match launchImage files for all devices?

At the moment I can either have a good iPhone X transition or a good iPhone Plus transition but not both.

Is my only option to try to detect if it’s an iPhone X (or iPhone Plus) and swap the images programatically?


Solution

  • So here's the solution for a landscape only app. Hopefully it will help a little for portrait orientations too. Landscape bespoke launch images should be placed as shown with these width/height class settings.

    Use the launchImage.xcassets screenshot at the top of the question to set up your launchImage.xcassets.

    enter image description here