iOS 8: Launch Screen StoryBoard appears black [single XIB file works fine] iOS 8: Launch Screen StoryBoard appears black [single XIB file works fine] ios ios

iOS 8: Launch Screen StoryBoard appears black [single XIB file works fine]


Read through the tutorial and tested it, and it doesn't say two things:

1: You'll need to add a UIViewController to your .storyboard file, and then select it as the Initial Controller.

2: If you wish to change more than just the launch screen, you'll have to go to the project settings and set the "Main Interface" to your corresponding .storyboard.

Once that is done, all you need to do is edit the UIButton/Label/etc connections to your ViewController classes.

EDIT:

For clarification, you can set a UIView as the initial controller by selecting it in it's respective storyboard file, then opening the Attributes Inspector. The option for 'Is Initial Controller" is towards the middle.


For people using UIImageView in the launch screen

Make sure that you are using the image name without the extension in the attributes inspector.

So for example, if your image file is named launcher.png, only use launcher as image name.

This will show the image as invalid (?) in the editor but will show correctly when run on device.

(Don't ask me why it works this way. Ask Apple.)

enter image description here


None of the answers have all the steps required, hence this exhaustive solution.

Storyboard

Start by creating the LaunchScreen.storyboard. Xcode > File > New > File... > Storyboard > LaunchScreen.storyboard and add it to all appropriate targets.
In this storyboard, create a single view controller of type UIViewController. Do all the magic your launch screen requires, then follow these steps:

  1. LaunchScreen.storyboard > Show the File inspector > Use as Launch Screen

  2. LaunchScreen.storyboard > View Controller > Show the Attributes inspector > Is Initial View Controller

  3. Project > General > Deployment Info > Main Interface > LaunchScreen
    Repeat for [iPhone] and [iPad]

  4. Project > General > App Icons and Launch Images > Launch Screen File > LaunchScreen

  5. If setup properly, your Info.plist should have LaunchScreen .storyboard, without the .storyboard under the UILaunchStoryboardName & UIMainStoryboardFile properties:

    <key>UILaunchStoryboardName</key><string>LaunchScreen</string><key>UIMainStoryboardFile</key><string>LaunchScreen</string>

Notes:

  1. This is not incompatible with having legacy images for older devices using Launch Screen File > Assets.
  2. Pay special attention to LaunchScreen.storyboard and Main.storyboard. One is used for launch, the other for your app entry point. They both need to have Is Initial View Controller set.