8
votes

I am making a test sprite kit game, and when I run it on the device, the splash screen doesn't show up although it does work on the simulator.

Here are some screenshots:

Declaring of splash screen properties in settings window

Normally I set the target to iOS 7.1 and later, so I use a .xib file and LaunchImage file in xcassets.

Here are the properties of the .xib file

I have put 2 correctly sized splash screens in the iPhone portrait iOS 7&8 section, and have selected "Portrait" under iOS 7 and later. The link from the settings file is definitely going to the correct file.

When I run it on the simulator (presumably all devices are iOS 8), the .xib file is used and it displays that splash screen.

When I run it on my iPhone 4, it displays a black screen. In my other apps, it would choose the image from xcassets and display it, but this is not the case.

Does anyone know how I could solve this problem?


Edit

Basically, I have put 4 images into xcassets for a splash screen. I have selected iPhone portrait for iOS 7 and iOS 8.

In the settings pane I deleted the launch screen file reference, so the only reference is to the xcassets launch image (It points to the correct place). I have also deleted the LaunchScreen.xib file.

But when I run the app on the device and the simulator, no splash screen shows up.

4
Try lowering your deployment target. Try 6 ... - M Abdul Sami
What are your settings for App Icons and Launch Images under the General settings for your target (that is, is the Launch Image setting pointing to the correct assets)? - Brad Brighton
@MAbdulSami that doesn't seem to work. Thanks for answering. And Brad, yes they are, but thank you for giving it a go :) - 13509
An easy work around would be to provide splash images for all supported screens and removing .xib splash. And make sure you delete that entry of launch image from info.plist. - M Abdul Sami
@parkgatedev If you want to use assets catalog with custom launch images (and without .xib) you probably have to leave Launch Screen File field blank. Take a look at this to see if it helps: stackoverflow.com/a/29370830/3402095 - Whirlwind

4 Answers

6
votes

I faced similar issue and fixed by Restarting the Mac and iPhone

3
votes

Uninstalling the app from Simulator/ iPhone helped to fix this issue.

2
votes

I was having the same problem, and I finally figured out a solution. I want my launch screen to show up on ALL devices capable of running iOS 7 or later, when running my landscape-only Sprite Kit game. Most devices that run iOS 7 can be upgraded to iOS 8 or greater, except for the iPhone 4 (which is stuck with iOS 7.1), and the launch screen wasn't appearing on my iPhone 4 test device. Then I stumbled across Apple Tech Note TN2244. As described in the Tech Note, once you edit the info.plist to enable landscape orientation for iOS 7.0+ iPhone launch images, the correct launch image will appear. As a side note, if you disable the launch image asset catalogs as suggested, the XCode Swift compiler gives you warning messages -- but you don't really need to disable launch image asset catalogs, and if you configure them properly the warnings will disappear and landscape launch images will now work just fine on all devices, including iPhone 4.

-1
votes

Your app's launch image is displayed as soon as your launch your app. Hence the name. It is removed when the appDelegate appDidFinishLaunching: method runs. If you are app has very little to load, your image might get displayed and removed before you have time to see it.

If you want to manually set a longer display time for your launch image, you can add this code to the appDidFinishLaunching: in the appDelegate.m file:

sleep(4);

4 being the number of seconds.