1
votes

I know this question may seem like a duplicate of a few existing ones but its not.

I am struggling with this issue where universal (iPad/iPhone) application does not display the splash screen anymore.

Before upgrading to iOS 9 and Xcode 7, no such issues were present. After upgrading no changes were made to the splash screen in any way.

Tech data relevant to the question:

  • Supported devices are iPad (landscape only) and iPhone (portrait/landscape)
  • I use "Launch Screen.xib" that has an UIImageView with size classes and constraints set up so that it's always full screen.
  • I have added all splash screen images in image assets (except iPad Portrait ones)
  • I use Xcode Version 7.0.1 (7A1001) and iOS 9.0.2
  • This issue does not happen on an iPad

The wrong splash screen looks like this on iPhone 5s: iPhone5S showing wrong Splashscreen

This is made in portrait mode, so there are white squares on top and on bottom of this "black square".

I was struggling with this issue yesterday but I managed to fix it by renaming my launch screen to "LaunchScreen.xib" (without the space). But this morning the issue re-appeared.

Things I've tried:

  • Removing and creating LaunchScreen.xib again with and without space
  • Creating LaunchScreen.storyboard file instead of xib
  • Adding @2x and @3x versions of image used in LaunchScreen.xib
  • Removing/adding/replacing images in image assets
  • Cleaning, build cleaning and even deleted derived data
  • Restarting device, reinstalling app, relaunching without building and many other solutions that I could think of.

Nothing helped, so maybe someone fixed a similar issue already and can lead me to the right direction.

EDIT 1

So I renamed my LaunchScreen.xib image used from "Default.png" to "DefaultSplash.png". This instantly fixed all issues on iPhone. But now I have a new problem - iPad splashscreen is now black. If I set the LaunchScreen image to some other image used in project, the Ipad displays it as splashscreen without any problems, but neither Default.png nor DefaultSplash.png can be used on ipad now. This is really weird issue.

4
you could try building an archive for an ad-hoc build and export sliced variants. ("Export for specific devices" option in export wizard). that is helpful to see if any resources are missing from the output...Martin Ullrich
@MartinUllrich That is a very interesting approach to this issue. I will surely try this out in few minutes.avuthless
i'd also try the "use as launch screen" option in the interface builder Utilities Panel (File Inspector > Interface Builder Document > right below "use size classes". Maybe also turning it off and on again..Martin Ullrich

4 Answers

2
votes

In my case the images in the "Launch Screen.xib" weren't displaying. I had to rename them and reset the new names in the nib file to make it work.

2
votes

So I fixed the issue like this:

Since I renamed the file LaunchScreen.xib, it fixed an issue on iPhone but caused a similar problem on iPad. Since then, I cannot use the same image file name for the same xib (i.e. if image "Default.png" failed, it cannot be used anyomre... Bug?). So I created two files, LaunchScreen.xib and LaunchScreen~iphone.xib with separate image files for each. Now it works okay.

Seems ugly and buggy but it works.

0
votes

There is a change in Xcode7 iOS 9 onwards. They have modified Launchscreen(Black screen we will get).If you change deployment target means you can see the previous launch screen. Only empty view controller is present so we have make changes on it. As per requirement in assets add images in imagecassets.

0
votes

It may sound stupid but something related to this scenario may happen:

If you hook any outlet and then break it by changing the custom class you will get this black screen behavior without any warning, instead of the typical crash from any non launch storyboard/scenes this will lead to a black screen before the app start.