I want to get a simple launch screen to show in my app, built using Xcode 6.0.1.
I have added a launch screen in two ways: As an XIB (with the default name, LaunchSc
I've read about a bug in Xcode 6 which prevents landscape only apps from displaying a launch image.
Try to set images and orientation within Images.xcassets:
My suggestion to you is to select Launch Image Source as Image.Assets. Create splash image assets there in Image.assests folder.
Reference image for right configuration:
So this has been quite painful for something that should be trivial. Here is what I did:
Use xcassets
I decided to use .xcassets versus the .xib for launch. I deleted the .xib. If you have images.xcassets already in your project then great, otherwise you can add one from File>New>file:
Create a Launch Image Set
Now create at a minimum a launchimage set and icon set in your .xcassets file by right clicking in the navigator area.
Update the App Icons and Launch Images Settings
Then I made sure that the "Apps icon and image sets" in my target are as below.
Very Important: Make sure the "Launch screen file" setting is blank.
Add the Images
Last but not least, the terminology used by Apple for the device selection is confusing. Initially I thought that since I am deploying for iOS8 only (iPhone Portrait), I can do this and just put in the iPhone 6 and iPhone 6+ launch images:
I quickly realized that is not the way this works and I was getting a warning: "An iPhone Retina (4-inch) launch image for iOS 7.0 and later is required."
So I had to select the iPhone under iOS 7.0 and later as well and add an Image for the iPhone 5s.
So to find out which boxes to check on the right, do not ask the question: What is my minimum iOS and device and device orientation but rather ask:
What devices out there can support my minimum iOS? Now What is the minimum iOS supported on those devices? And make sure you check all of those boxes. So for me, I am targeting iPhone 5s, 6 and 6 Plus at 8.0 but given that iPhone 5s can exist with 7.0, I need to check the 7.0 box as well to show the image placeholder. In other words, the (iOS) check box on the right shows you the minimum iOS version available for that device and you need to click it to show the image placeholder and put an image regardless of whether you are deploying at this iOS version or not.
Hope this helps somebody.
For me, it worked when I uninstalled the app and then restarted the simulator. When installed again, launch image appeared as expected. This also worked on an actual device.
One way is to also add "Launch Screen" (LaunchScreen.xib
), paste the image into UIImageView
and then set it to "Horizontal Center in Container" and "Vertical Center in Container" in "Align" if you are using Auto Layout.
Screen: http://i.stack.imgur.com/CfnHT.png
Don't forget to put LaunchScreen.xib
into "Launch Screen File".
If you have changed your launch image from a previous image, and observe the following:
It is likely because of the caching of launch image done by iOS. Rebooting the device should solve the problem.