I can confirm that this also happens to my project.
I use a LaunchScreen.xib file that has a couple of images and the Logo image centered. If ran on a device, the Logo image's not loaded, all other images are loaded. If ran on the Simulator, it works properly. I even tried putting the image to a different UIImageView element in the app and the image renders without issues.
Additional fixes attempted
- Replacing the image with a new logo
- Putting in another random image as the logo
The image renders fine (but there are other random images that do not render)
Hopefully we can get an answer about this since it completely blocks a release on the App Store.
I don't know if this will help anyone. I was having the same problem. I had several images on my launch screen that stopped showing up.
I did three things (the first two on their own didn't do it, but may have assisted the third which did work)
1) Copied all of the images to the root directory (same location as xcode puts the images)
2) Created a folder in Images.xcassets and put the images in there.
3) The images in the launchScreen.xib were originally called imageName.png. This was changed to just imageName (remove the file extension.
After the third thing the images appeared. I don't know if either of the first two steps are required, but hopefully it will help someone.
I was just having the same problem on my iPhone 6s running iOS 9.1 with an app I'm working on.
The solution for me was simply to make sure that the "Clears Graphics Context" box is unchecked for the UIImageView in the storyboard. Just changing this fixed it for me - I actually had another image in that same storyboard that had that box unchecked and it was already showing up.
A StackOverflow answer by @jaga provides the solution, but not the reason, as to why UIImageViews are missing in the Launch Screen on device (but not in the simulator).
Recently I attempted to use a custom font in my "Launch Screen.storyboard" file.
The reason I could not became clear after reading this StackOverflow answer by @TimCamber, which prompted me to do a little more research and testing.
The reason that a custom font is not included in my Launch Screen Storyboard file is the same reason an image within an asset catalogue is not included...
The app prepares portrait & landscape snapshots of the app's Launch Screen from your Launch Screen Storyboard file and (currently) saves it in your app bundle:
- here /Library/Caches/Snapshots/<<app_bundle>>/;
- and here /Library/Caches/Snapshots/<<app_bundle>>/downscaled/.
This process to prepare the launch screen is complete before any supporting files are loaded, including any custom fonts and the asset catalogue.
As mentioned above by following @jaga's solution, literally all that is required is to:
- (old school) add an image file (.PNG) to your app's bundle; and
- reference that image in your UIImageView object in the Launch Screen Storyboard file.
Example 1: Screenshot of Project Navigator in Xcode - image file added under the Supporting Files subdirectory in an Images subdirectory.
Example 2: Screenshot of Attributes Inspector in Xcode - Image View section detailing reference to the image file used for a UIImageView.
Sadly, this still doesn't fix the problem. I had hoped this might be the issue because I do use a custom font on my launch screen, but the proposed solution did not work. The only thing that works is changing the name image file in the LaunchScreen.storyboard file from myLaunchImage.png to myLaunchImage. When I do this, the launch image shows up again. But as soon as I make a modification to the Main.storyboard, the launch screen goes black again. When that happens, I go back to my LaunchScreen.storyboard file and then change the image name again. This time I switch it back to myLaunchImage.png. This is maddening. Why would removing the image file extension (or re-adding it) temporarily fix it? And why is a modification of Main.storyboard impacting the display of the launch image.
@jeffb6688 custom fonts and the asset catalogue are not loaded into memory by iOS in time for the app to display these in the launch screen storyboard.
This is why iOS prepares cached snapshots of the launch screen. The cached snapshots are used at launch, not the supporting assets.
The workaround for images is as I described in my answer (in response to question by OP).
The workaround for custom fonts is more complicated.
Regardless of where they are placed in the file system, custom fonts are not loaded into memory by iOS in time for the app to display these in a launch screen storyboard.
So the workaround... we must prepare static image files that contain the custom font as a part of (embedded into) that image, in a size and layout to suit each screen orientation, size and resolution.
It won't take long to realise that this can become a significantly time consuming exercise given the great number of possibilities for screen orientation, size and resolution.
We could complain about this but Apple makes it clear in their iOS Human Interface Guidelines that launch screen images are not intended to be traditional "splash screens".
In their words...
- Design a launch screen that’s nearly identical to the first screen of your app.
- Avoid including text on your launch screen.
- Downplay launch.
Yes, Apple still approves apps with traditional splash screens, however this is contrary to their iOS HIG.
I'm working with iOS 9. I crafted a Launch storyboard file and it worked. Then I changed some other stuff, and it stopped working. My app would start with a black screen. After much reverting with GIT and searching the internet, I discovered my problem:
One of the things I had done was rename an image used in the launch storyboard. "Gradient.png" became "Splash Gradient.png". I took the space out and it worked again!
It seems that if your launch storyboard has a UIImageView with an image whose filename contains a space, the entire storyboard won't launch. Same is true for a launch XIB (which I tried).
Has still similar problems.
I changed existing image with new one on launch screen (by drag drop 3 images 1x 2x 3x recpectfully)
First, previous image shown long time. To get rid of it I deleted UIImage on launch screen re created a new one. Link with the name image; result : no image at all. This is not about alpha channel , I tested.
To resolve after many try, only thing which worked for me;
Creating; New image name (I mean newlogo.png) and new asset in Xcode with different name.
Then using it made work. I could see the new correct image.
I know this post is old, but maybe this will help...
I had the same problem, but found out that it depended on where I put the image. The "Main" and "Launch" Storyboards were looking for an image in one Assets folder, while the app was looking for images in another.
I put the images into the correct folder, and the problem was instantly solved!