Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch screen storyboard for multiple devices and different orientations in iOS

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.

like image 758
Srivathsa Avatar asked Sep 06 '16 12:09

Srivathsa


People also ask

How do I launch storyboard in screen?

storyboard to configure your launch screen. If your project doesn't contain a default launch screen file, add a launch screen file and set the launch screen file for the target in the project editor. Choose File > New > File. Under User Interface, select Launch Screen, and click Next.

How do I set launch screen in SwiftUI?

Adding a Launch Screen In SwiftUI projects, the launch screen is not generated by default. You need to add it manually in the Info. plist file. After opening the file, you should see an entry named Launch Screen.


1 Answers

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.

like image 128
Ketan Parmar Avatar answered Sep 20 '22 14:09

Ketan Parmar