0

I was trying to update the icon of my app in LaunchScreen, turned out that the UIImage doesn't update for the situation that a user update from old version to new version, and I searched on web for some solutions, there is one suggesting that I should load image files that are out of the *.xcassets folder, I know how to put the image files to my project root directory, but I don't know how to load it in storyboard, as LaunchScreen.storyboard can't have a view controller class

So my question is: How to reference image files in storyboard

This is the source link: http://arsenkin.com/launch_screen_image_cache.html

SamB
  • 1,560
  • 1
  • 13
  • 19
Zim
  • 674
  • 7
  • 15
  • If you just add an image file to your project, what do you see under the attributes inspector? If you see that image file under the attributes inspector, you can access it merely with `UIImage(named:)`. – El Tomato Aug 23 '21 at 23:59

1 Answers1

-1

You can't use any custom behavior in LaunchScreen.storyboard. And loading images from anywhere except *.xcassets is a custom behavior.

Generally you'd use something like

let path = Bundle.main.path(forResource: "image", ofType: "imageType")
let image = UIImage(contentsOfFile: path!)

to load such an image, but as I've already mentioned, this approach doesn't work for launch screens