Ios – Launch screen storyboard for multiple devices and different orientations in iOS

iosios-autolayoutipadlaunch-screenxcode-storyboard

My application supports all devices from 4 inch onwards in both orientations.

iPhone – 5, 5S, 5C, 6, 6S, 6+, 6S+, SE

iPad 4, iPad Air, iPad Air2, iPad Pro etc

Using asset catalog for launch screen its working fine but in iPad Pro app displays standard keyboard rather iPad Pro optimized keyboard which is bigger and doesn't give best user feel.

As per below link app should be using launch storyboard rather than asset images to get optimized iPad Pro native keyboard.

https://forums.developer.apple.com/thread/26357

Now question is how to support both orientations during launch screen storyboard ?

How to add different launch images for portrait and landscape modes in storyboard ? Using size class for iPad in both orientations its both Regular and Regular size.

Note – Because it launches a screen storyboard, one can't customize the size class with custom class.

Best Answer

In your launchsScreen.storyboard add imageView and set it's four constraints like : top,bottom,leading,trailing.

Now, in your assets add separate images for iPhone and iPad with 1x,2x,3x resolution for iPhone and 1x,2x for iPad.

And set that image to that imageview. It will manage then for every device!

You can set different images for different size class in assets. So for different orientation you can set different images in assets.

refer Apple documentation for more details.

And yes you can use vector graphics as suggested in comment by @pkc456 to keep your app light weight.

Related Topic