2

I just would like to set a LaunchScreen image using an image from the Assets.xcassets file.

In Assets.xcassets, I'm adding a "New iOS Launch Image", and provide the image in PNG.

In Project > General > App Icons and Launch Images, I have the settings below:

App Icons Source: [AppIcon] (->) (Clicking the arrow leads to the Assets folder.)

Launch Screen File: LaunchScreen (No arrow, nothing.)

There is no "Launch Image Source" option for some reason, I keep seeing it in all other solution suggestions online about this LaunchScreen issue.

These are the relevant files I have in my Xcode project file tree:

Assets.xcassets LaunchScreen.storyboard

Results: LaunchScreen is just appearing empty...

I have done a lot of Googling, checked many posts about this. Tried deleting the application and the project itself and retrying from scratch several times... I'm quite lost.

What am I doing wrong here? I just would like to display a LaunchScreen image from Assets.xcassets...

PS: Sorry for not being able to embed images, SO only allows me to include URLs to images until I collect more reputation points, which I find total nonsense.

itsafox
  • 71
  • 2
  • 5

1 Answers1

1

Now in Xcode 11 we can't set the launch image from "App Icons and Launch Images" section in the general tab and stoaryboard is the only way to design the launch screen. The "launch screen file" tells the storyboard name which will be loaded on the app launch.

Place the UIImageView in the LaunchScreen.storyboard and set your imageview with the asset you want from Assets.xcassets.Check this image for reference

nee
  • 56
  • 2
  • So, I tried adding the assets name, but neither the filename for the image itself, nor the name of the asset category "LaunchImage" works... – itsafox May 07 '20 at 18:10
  • Actually, if I directly put the launch screen image onto the pane on the left, in the Assets window, I can reference it from ImageView Inspector. However, if I put the launch screen image into a "LaunchImage" group in the assets, using "New iOS Launch Image", I can no longer reference it... – itsafox May 07 '20 at 18:14
  • Yes add ur assets as "new image set" and add to imageView Inspector. No need to make the asset as "New iOS Launch Image". It will work. – nee May 07 '20 at 19:10
  • I see... it indeed works, thank you! But wouldn't the proper way of doing this be adding a new image set using "New iOS Launch Image"? How to make it work if I specifically want to use "New iOS Launch Image"? – itsafox May 08 '20 at 08:18
  • "New iOS Launch Image" is for ios7 and earlier. look into (https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/AddingImages.html) for clarity. Plz vote if useful – nee May 08 '20 at 21:26