Launch screen is black when set to a storyboard file
Asked Answered
L

3

8

I am using a storyboard to get the correct height of a navigation bar in my launch image.

However, after customizing the view controller a bit, it now displays a black screen instead of a launch image.

When I set it to a brand new view controller, everything is fine. It seems like the original view controller is now in a bad state.

How can I fix this?

(I'm running iOS 8.2 simulator on Xcode 6.2.)

Lewislewisite answered 2/4, 2015 at 18:32 Comment(0)
L
12

The problem in this case was that there was an outlet set on the view controller.

If there are any outlets on the initial view controller (or, if the initial view controller is a navigation controller, the root view controller), the system will not render any launch image, and instead show a black screen.

In my case I have my target's Main Interface set to the same value as the Launch Screen File (both set to storyboards). Once it launches the real app, I want to manipulate the view a bit (hence why I had an IBOutlet). After deleting the IBOutlets, I was able to manipulate the view by using -[UIView viewWithTag:].

Note: When the view controller is being used to render an image for the launch screen, none of the code in the class is called (e.g. -[UIViewController viewDidLoad] is never called). On the other hand, when the view controller is being used for the Main Interface, the code is executed normally, as you would expect.

Lewislewisite answered 2/4, 2015 at 18:32 Comment(1)
This helped me, Thanks :) For some animation logic they connected the image to the ViewController. After removing that connection it works :)Anchorage
I
2

For me the fix was to check "is initial view controller". Before that I got only a black screen, now finally I get the View Controller as the Splash

enter image description here

Influenza answered 30/10, 2017 at 8:36 Comment(0)
M
0

If everything is fine but still Blank black screen appears ... it may be caused by a static size .png image ... either use multiple sizes.png or go for .svg or .png single image ... also In iOS 14 and later, the launch screen is limited to 25 MB according to Human Interface Guidelines by apple.

Malcommalcontent answered 12/1, 2022 at 8:16 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.