23

I'm trying to get the Launch screen to display instead I get the default black screen.

I remember I've had this issue in the past and is something really silly but I can't remember what it is.

I have a LaunchScreen.xib. I've set in my target -> info to use LaunchScreen and not image catalog. I am running iOS 8 and using Xcode 6.1. I tried on all iPhone simulators and iPhone 4s.

I can't think what more info to give than that.

user1898829
  • 3,437
  • 6
  • 34
  • 62

18 Answers18

32

For those who are still looking for another answer here's what worked for us:

Our launch xib only contains an imageView in the middle of the view. For some reason the image never showed (but the view was there, checked it with changing the background color).

The solution was to move the image file out of the image catalog and just drop it in the project as a standalone file. Pretty strange considering when we tried other images from the catalog they appeared correctly but not this one. Anyway, I hope this helps someone!

jaga
  • 459
  • 4
  • 7
  • 3
    Recently I attempted to use a custom font in my "Launch Screen.storyboard" file. The reason I could not became clear after reading [this SO answer](http://stackoverflow.com/questions/25794314/using-custom-fonts-with-xcode-6-ios-8-interface-builder-launch-screen) and a little more research / testing. It is the same with an image... Xcode prepares portrait & landscape snapshots of your app's launch screen and (currently) saves it here: `/Library/Caches/Snapshots/<>/`. This is done before system / supporting files are loaded, including custom fonts and the asset catalogue. – andrewbuilder Apr 19 '16 at 02:24
  • I just spent 2 hours figuring this out ...so yes, as of right now, this is still a problem – Tony Apr 26 '16 at 23:19
  • This worked for me too...thanks a lot, But I still don't understand, what the problem was before ..? –  Aug 22 '17 at 09:59
  • 1
    [This answer](https://stackoverflow.com/a/35783070/5555803) worked for me. – Orkhan Alikhanov Apr 29 '18 at 18:50
26

I had the same issue. Turned out that I had earlier tried to attach a viewcontroller file with the launchscreen. To fix:

  1. Go to launch screen
  2. Click Connections Inspector in right pane
  3. Remove all connections.

Accoring to @doctorBroctor: also go to the File's Owner tab and remove the connections there.

Kashif
  • 4,642
  • 7
  • 44
  • 97
8
  • Go to your launch screen
  • Go to file inspector
  • Check the checkbox for "Use as Launch Screen"

enter image description here

aryaxt
  • 76,198
  • 92
  • 293
  • 442
8

I have tried with:

  1. Deleted Launch Screen File.

  2. Tapped on Use Asset Catalog in Launch Image Source and added Splash screen Images as desired in the image asset.

  3. Deleted Previous Project on Simulator or Device. Clear the Project.

  4. Run Again and it is showing now.

Manab Kumar Mal
  • 20,788
  • 5
  • 31
  • 43
6

One reason for why you might experience the black screen instead of your launch screen is that the .xib file might not get copied in your build phase. At least that was my issue that caused my app to show the black screen even though I had done the steps you describe.

So, double check that your LaunchScreen.xib (or whatever it is named) appears in:

Your target -> Build Phases -> Copy Bundle Resources

And if not, make sure to add it. That resolved my issue.

Steffen D. Sommer
  • 2,896
  • 2
  • 24
  • 47
6

For me the problem was that I hadn't selected the LaunchScreen.storyboard in the General tab of the project settings.

enter image description here

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
  • Worked for me, and to clarify, I changed the setting from "LaunchScreen" to "LaunchScreen.storyboard" and problem was resolved. Also note that the original setting "LaunchScreen" is no longer showing as an option. Seems like an xCode bug. – ehmjaysee Jul 09 '19 at 21:27
4

I've experienced the same issue. The solution for me was simply delete the app, reboot the device, then reinstall it. I think iOS caches the Launchscreen, and this cache is not invalidated every time when it should be.

gklka
  • 2,459
  • 1
  • 26
  • 53
  • 1
    Rebooting the device was the key indeed. Found it out myself, but good to check this. Sometimes a fix can be so easy. – Johan Jan 08 '22 at 18:46
3

I had the same issue in iOS 9 as well. Deleting the old app in simulator alone is not enough. Simulator has to be quit launched. It worked for me.

Anand
  • 1,820
  • 2
  • 18
  • 25
2

I fix it by select the "is Initial View Controller" in storyboard.

Han Pengbo
  • 1,338
  • 1
  • 18
  • 37
2

Make sure to delete the installed app from the emulator. Then run the app again from xcode (product->clean, product->run). That worked for me.

erwinnandpersad
  • 376
  • 5
  • 16
1

I've looked at all the above answers, it helped a bit. Especially the answer by Suragch put me in right direction.

The LaunchScreen.storyboard isn't showing up, even after applying simple background colour to the view and removing the image.

Firstly, I cannot see the "LaunchScreen.storyboard" as shown in the imagebelow

This was because, some reason the LaunchScreen.storyboard wasn't added to the build Target. Solution: Ensure the LaunchScreen.storyboard is included to the build Target. Also, Choose the LaunchScreen.storyboard from the drop down as shown in above pic.

I hope it helps someone!

Santosh
  • 581
  • 7
  • 17
1

I found this old post 'cause my launch screen WAS working, then it stopped. I thrashed around for a good while and then realized this, undocumented problem:

If your launch XIB or storyboard file has a UIImageView with an image whose name contains a space, the entire screen won't load.

0

New feature in the iOS 8 SDK: you can now use a storyboard scene in place of your app’s launch images.

  1. Create a blank storyboard file named LaunchScreen.storyboard.

  2. Go to your target settings and, on the General tab, select the storyboard as your Launch Screen File. Xcode will add a corresponding UILaunchStoryboardName key to your app’s Info.plist. When this key is present, Xcode will prioritize it over any launch images you might have set.

  3. Add a view controller scene to the storyboard. Add some subviews to the scene and position them with constraints. When you launch the app on a device, the OS should use the scene as the launch screen.

For more information check out this blog post by Ole Begemann "Replacing Launch Images With Storyboards".

shim
  • 9,289
  • 12
  • 69
  • 108
Fatti Khan
  • 1,543
  • 1
  • 11
  • 19
0

I only had a centered UIImageView in my LaunchScreen.xib that contained an image (.png file), and had the same black screen showing.

I removed the image (the .png file) from the project, added it again with new name, and used the new image.

Boris
  • 389
  • 4
  • 12
0

Make sure to use empty Launch Screen File, then Xcode would use Launch Image Source.

Roozbeh Zabihollahi
  • 7,207
  • 45
  • 39
0

Make sure you have "is initial View Controller" checked in interface builder. I tried pretty much everything else but this finally fixed the problem and now it works in simulator as well as the device.

Richard Good
  • 71
  • 1
  • 4
0

Reset Simulator working for me

Reset Simulator

For iOS 14 and newer:

Device > Erase All Contents and Settings...

For iOS 11 and newer:

Hardware > Erase All Contents and Settings...

For previous versions:

Simulator > Reset Content and Settings...

Asil ARSLAN
  • 1,066
  • 2
  • 14
  • 31
-4

Your launch image should be a PNG. A JPEG may work under certain targets, but you should use PNG anyway.

Richard Sprague
  • 333
  • 2
  • 6
  • He is not using an image as a launch screen so your answer does not help him, he is using a nib file to produce a launch screen. – Anil Dec 22 '14 at 16:01