How can I tell Asset Catalog (.xcassets) to use the Same Image for Multiple Image Wells? How can I tell Asset Catalog (.xcassets) to use the Same Image for Multiple Image Wells? ios ios

How can I tell Asset Catalog (.xcassets) to use the Same Image for Multiple Image Wells?


You can right click on the .xcassets file and choose 'Show in Finder'. Go to the 'Image.launchimage' folder and open the Contents.json file in a text editor. Here you can see that unassigned slots don't contain an "filename". You can add this manually. For example change the following:

{    "orientation" : "landscape",    "idiom" : "ipad",    "extent" : "full-screen",    "minimum-system-version" : "7.0",    "scale" : "2x"}

Into:

{    "orientation" : "landscape",    "idiom" : "ipad",    "extent" : "full-screen",    "minimum-system-version" : "7.0",    "filename" : "Default-Landscape@2x~ipad.png",    "scale" : "2x"}

Now safe the file, and voila!


I solved this by using build scripts to copy the right xcassets file in for each target. Details here


I think I've found the solution: Simply drag the default images that you want to be used for iOS 6 and 7 into the iOS 6 bucket. You get a warning about not having an iOS7-only image but the build works in the iOS7 simulato, an iOS7 iPhone and an iOS7 iPad.


matomo