Question

I am trying to create a launch image for my (first) iphone app. I have done the following:

  1. created 2 PNG images for this purpose.
    one image is: 640 x 960 pixels the other is: 640 x 1136 pixels

  2. added the above 2 files to my project, under "Supporting Files"

  3. In the asset catalog, I select my "LaunchImage" image set, and set its attributes to only support iPhone Portrait, iOS 7 and above

  4. I try to drag each of images mentioned above from "Supporting files" into the 2 place holder images (Retina and @2x). The images are not accepted. I do not get an error, but the images are never drawn, and the image is not used when the application launches.

  5. If instead I try to import the files by selecting "import" from the context menu, I get the same behavior. No error, no image.

Do I need to do anything else? Like follow a naming convention?

Per what I have read, the names of these files no longer matter - though I have tried naming them: LaunchImage.png (640x960) and LaunchImage@2x.png (640x1136). This has not made any difference.

Any help would be greatly appreciated.

Was it helpful?

Solution

Just change the file extension from "PNG" (upper-case) to "png" (lower-case). I spent a couple of hours futzing around until I finally figured out that was the issue!

Note that screenshots taken with a physical iOS devices have "PNG" extension, and will never work until you change the extension. But screenshots taken on the iOS Simulator have extension "png" and work fine as is.

I've logged this in the Apple Bug Reporter as an XCode Usability issue: 17676619 Can't drag "PNG" to LaunchImages; only "png" works

OTHER TIPS

Have you tried dragging the images straight from the Finder into the Asset Catalog? You shouldn't need to drag them into your project as an extra step first.

The other thing to check is that they are definitely PNG images; the Asset Catalog doesn't accept JPGs.

Had the same issue today. It happened only with a single image. To solve it you have to re-save your image using a picture editor (Preview for Mac).

  • Launch Preview
  • Open your image
  • File -> Duplicate
  • Save it as another file
  • Drag and drop new file into asset catalog -> it works!

I was finally able to import the images. I must have messed something up prior, as I am certain that what I had to do should not have been necessary. But, in case anyone else runs into a similar dilemma:

  1. I deleted the "LaunchImage" image set from the assets catalog
  2. In the build settings, I changed the Asset Catalog Compiler Options to not have any image set named as the launch image.
  3. In the assets catalog, I then created a new launch image set, using the context menu option "New Launch Image".
  4. I was now able to successfully import both my images.
    At this point, my app finally had a launch image - but it was the wrong one (i.e., 4 inch). This got fixed when I:
  5. Changed the Asset Catalog Compiler Options (in the Build Settings) to again specify the "LaunchImage" as the launch image catalog

FYI: I had previously tried adding a new launch image set, but had still never been able to import my images. It seems like the trick was to change the compiler options - but I have no idea why.

Not a substantially different answer, but just for someone who needs something more explicit, my images were saves as .jpg, which will not work. Open the photo editor of your choice and save as .png.

It’s back. In Xcode 10.2 dragging an image into an asset Catalog only works with one image. Then you need to close the project and open again to add another image.

They display in the catalog, but if you right click and Show in Finder, the image is not copied to the catalog folder. When you close and open only the first one remains.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top