Dhugalmac
Dhugalmac

Reputation: 574

iOS Launchscreen.storyboard Image not showing

I am using Xcode 7 and Swift to create an iOS project.
My current problem is that my LaunchScreen.storyboard Image is not appearing when I launch a Run.

To my Project I did a File - New - File - iOS - User Interface - Launch Screen. That added a Launchscreen.storyboard to my project. I then set its Background to Black (so far, so good). And I have the ViewController's "Use Size Classes" un-checked to preserve the visual sizing.

Now I added an ImageView to the View and set its Image file to my desired Logo png file. All visually appears OK in the Development GUI.

But, when I launch the Run the Black screen momentarily appears before going to the subsequent screen, but the Logo does not appear on iPhone within the initial Launchscreen

Obviously I am doing something wrong, but I do not know what.

Upvotes: 2

Views: 6673

Answers (4)

Adrian
Adrian

Reputation: 1

I resolved this exact issue by selecting the Launchscreen.storyboard then selecting the View Controller then opening up the Attribute Inspector and checking off the box that says "is initial View Controller". Hopefully it helps somebody after all these years.

Upvotes: 0

Manish Mahajan
Manish Mahajan

Reputation: 2082

  • Delete Derived Data.
  • Delete app from Device/Simulator.
  • Restart Device/Simulator and run app.

Upvotes: 5

Jeremy Petter
Jeremy Petter

Reputation: 39

I'd start by restarting the device (or quitting the Simulator). I think Springboard might be caching the storyboard file, such that even after the app is deleted and re-installed, it goes looking for the specific set of assets referenced in the original storyboard on launch. Restarting the device seems to make the image to show up, even without re-installing—I suspect because it clears Springboard's cache.

Upvotes: 3

caxix
caxix

Reputation: 1102

I had exactly the same issue and images in my LaunchScreen.storyboard were not appearing on any devices. I solved it by removing the launch images (1x, 2x, 3x) from the asset catalog and dragging them right into the project hierarchy like in the olden times. Additionally I had to explicitly add the image extension (.png) in IB. After that everything worked fine including Auto Layout, etc.

Upvotes: 5

Related Questions