Search code examples
iosxcodexcode9launch-screen

Adding images to Assets.xcassets, won't display on LaunchScreen.storyboard


I am recently having problems displaying images in my LaunchScreen.storyboard. I don't know if this is related or not, but I upgraded to Xcode 9 right before trying to add an Image View. Here are the scenarios that I am trying.

Working:

  • I can display images that I had in my Assets folder prior to upgrading. This works in both Main.storyboard and LaunchScreen.storyboard.
  • I can display new images on my View Controllers that are in my Main.storyboard

Not Working:

  • I cannot display new images in my LaunchScreen.storyboard.

I am wondering if I may have unintentionally changed a setting for my Launchscreen.storyboard as the problem does not exist in my Main.storyboard, but I don't know what setting this would be. But if this is the case, I don't know why it would display old images, but not new ones.

I don't believe that the images are the problem because I have duplicated the images in Finder, added the new image to my project, and I can still only get the original image to display (the duplicate won't). I have also tried images of several different sizes and types (.png and .jpg).

Any ideas?


Solution

  • Since the image is cached in iOS for quick launch, it does not get updated right away. These are the steps to follow if you want to see the new launch image appear.

    The following steps should erase the cached image that was on the device prior, and display the new launch image accordingly upon rebuild in step 8.

    Step 1 : Update the image in the Assets.xcassets

    Step 2 : In Xcode, go to Project -> Clean

    Step 3 : In Xcode go to File -> Preferences. Navigate to the Locations Tab, and click the little arrow next to derived data

    enter image description here

    Step 4 : Delete the DerivedData folder that opens up after clicking the arrow

    Step 5 : Restart Xcode

    Step 6 : Delete the app on the test device

    Step 7 : Restart the test device

    Step 8 : Build & Run the app on the test device