Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup different launch screen interface on ipad/iphone

I am trying to setup different launch-screen .xib file in my iPhone application.

I want to know is there any way I can setup different launch screen file in iPad version and iPhone version. Just like Xcode allows different storyboard for iPad/iPhone. I think there must be an option.

Have a look at below screen shot. launch file name

like image 575
ShujatAli Avatar asked Jan 05 '15 10:01

ShujatAli


People also ask

How do I change launch screen in Xcode?

Choose File > New > File. Under User Interface, select Launch Screen, and click Next. Give the launch screen file a name, choose a location, select the target that you want to add the file to, and click Create.

What is splash screen iOS?

A splash screen, also known as a launch screen, is the first screen that a user sees when opening your app, and it stays visible while the app is loading. You can control when the splash screen disappears by using the native SplashScreen API.

What is launch screen 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.


2 Answers

You can also use storyboard based Launchscreen and make device dependent layout in one file.

Layout your launchscreen for iphone with size classes (w: Any, h: Any), then change size classes to w: Regular, h: Regular and layout it again for iPad by uninstalling conflicting views/constraints and installing new.

You can read more about adaptive layout here: https://www.raywenderlich.com/113768/adaptive-layout-tutorial-in-ios-9-getting-started

I believe this is recommended approach since Apple introduced features like Split View. That way you can launch your app on iPad but with screen size of iPhone.

like image 152
Mr. Hedgehog Avatar answered Oct 26 '22 23:10

Mr. Hedgehog


I created two storyboard files for example: LaunchScreen_iPhone.storyboard and LaunchScreen_iPad.storyboard. Doesn't have to be those exact names. The file names are referenced from the Info.plist file.

In the Info.plist file edit the "Launch screen interface file base name" (UILaunchStoryboardName) key value to "LaunchScreen_iPhone"

Create another key-value entry in the Info.plist in the key name "UILaunchStoryboardName~ipad" and value "LaunchScreen_iPad"

like image 33
Gosoftworks Development Avatar answered Oct 26 '22 23:10

Gosoftworks Development