1

I have a storyboard for my iOS app. The storyboard is set to be the launch screen file so it acts as splashscreen at start.

In the storyboard I have placed an image. The image is not actually a .png, but an image from the Images.xcassets asset container in the project. I have defined for that 8 configurations:

  • 3 for universal
  • 3 for iPhone
  • 2 for iPad

All of them pointing to the same image.

Problem when running the app

When running the app, the storyboard starts, but the image does not show the correct image, but one of the icons from the AppIcon asset.

What is the problem?

Notes

I know you will ask me to use a plain .png file, but I need an image asset to be placed in the storyboard, this is just a requirement.

Andry
  • 16,172
  • 27
  • 138
  • 246

1 Answers1

1

First of all, your images still might be pngs. Right-click images in the asset catalog and select "Show in Finder" to see your source images. Secondly, 8 images seems like overkill. In all likelihood going with 3 images for universal or 5 for individual devices should be fine. Lastly and most importantly, in your LaunchScreen.storyboard, make sure that the right image name is showing up in the attribute inspector. Looks like you might have it set to AppIcon. enter image description here

caxix
  • 1,085
  • 1
  • 13
  • 25
  • I am sorry caxix this doe not help me unfortunately. The last point in particular, i have the correct name in place! – Andry Jun 02 '16 at 06:31
  • If you are not too far along you might want to post the project, because it is difficult to help with the information given. Also, you state " one of the images from the AppIcon asset". These are all the same image in different resolutions, right? – caxix Jun 02 '16 at 13:13
  • I took the same image and edited the JSON file in the asset folder so that I can point to one single image for the different combinations. So my fear is that the system checks the resolutions of the images... is it so? – Andry Jun 03 '16 at 07:58
  • That is not such a great idea. If you only want to provide one image, or maybe two drag the ones you have to their destination squares and leave the rest empty. Xcode will automatically use what you have in all cases. TO re-generate your JSON file make a copy of the folder on your hard drive and delete the image entry in the left column. Once done you can just drag the copies you copied back into the left-hand strip. – caxix Jun 03 '16 at 12:29