Launch screen is black when set to a storyboard file

耗尽温柔 提交于 2019-12-05 16:59:16

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!