4

First of all this question has nothing to do with other similar questions on SO because this problem involves using LaunchScreen.storyboard and the solutions presented on SO don't solve this problem.

I am using an image inside LaunchScreen.storyboard. I change that image and every time the app starts it shows the old image. Things I have tried:

  1. Name the image differently every time
  2. Delete de DerivedData contents
  3. Move the image from the Assets file to the outside
  4. Product > Clean
  5. Delete the app from the device.
  6. Do all 1-4 plus quit and restart Xcode.

It is amazing but nothing works. I have tried everything except voodoo.

The techniques above seem to work for images used elsewhere but not for images used by LaunchScreen.storyboard.

I am running it on the device.

Any ideas?

Duck
  • 34,902
  • 47
  • 248
  • 470
  • Do you change the image in code or in Xcode? –  Apr 24 '16 at 12:32
  • You cannot do that in code in LaunchScreen.storyboard it has to be by interface builder. – Duck Apr 24 '16 at 12:35
  • I know. Thats why I asked if you want to do that. It's not 100% clear from your question. Have you tried to use a debugger and testet if the image is nil? And can the image be loaded in code manually? –  Apr 24 '16 at 12:37
  • In theory the image is there, it shows inside the imageview, so it is not nil. – Duck Apr 24 '16 at 13:10
  • Still a bug in iOS 11.4. It seems (not exactly confirmed) as we can *move* the image using constraints and that will update the position of the image, however any attempts to update the image contents fail and the old image is always shown. – Jonny Jul 11 '18 at 20:51

1 Answers1

11

The likely problem is that Springboard caches the launch image by bundle ID. To force a rebuild, the necessary steps are

  1. Delete app from device.
  2. Restart device.
  3. Install and run app.

However, there does appear to be a so far undefined complete failure case. If the above brute force method fails to work, take a look at this Radar filing: UIImageView missing images in Launch Screen on device which appears to describe a permanent caching failure. In that case, changing your bundle ID and seeing if the expected image shows up is about all you've got left.

Alex Curylo
  • 4,744
  • 1
  • 27
  • 37
  • Ok, deleting the app solves the problem. The question here is: Xcode is appalling. This radar talks about this as being iOS 9 problem but I have seen this on iOS 8 before. At the time I did not give importance because I changed the way my LaunchScreen.storyboard would work. It is ridiculous I have to restart the device every time I change an image. Also, Apple takes ages to fix things and Xcode is a nightmare. Thanks for your answer anyway. – Duck Apr 24 '16 at 18:40
  • Actually, this problem of Springboard being obtuse dates back to iOS 2 -- we'd change the `UIPrerenderedIcon` Info.plist flag to toggle the application of the default gloss effect, and Springboard would merrily ignore what it was set to now and use its last cached icon. All old problems are new again! – Alex Curylo Apr 24 '16 at 18:52
  • Unfortunatelly this bug exists up until at least iOS 11.4 and on production/App Store builds(updates). We can't just force users to delete app and reinstall. – Jonny Jul 11 '18 at 12:32
  • It is in iOS13.2... :( – Gergely Kovacs Dec 10 '19 at 06:43