XCode Asset Catalog Weirdness

I have an iOS app that has mutliple targets. 23 of them to be exact and each one of them is an separate app in iTunes. That means lots of icons and lots of launch images. When asset catalogs came on the scene, I thought they were the answer to all my hopes and dreams. Maybe this isn’t the way they’re intended to be used, but what I did was create a separate asset catalog for each target and then assign the icons and launch images as needed.

As I was going through this herculean task of creating new asset catalogs, I noticed something weird.. by default, when creating a new asset catalog by migration (that is, migrating from the old “magic name” method of managing icons and launch images), XCode creates assets named “LaunchImage” and “AppIcon”. After setting all the icons and launch images for several target, I wanted to go back to a previous target and double check that I’d chosen the right image. I noticed that in the asset catalog dropdown on the “General” page of the project settings view, the proper asset catalog was not selected. Rather, the most recent one I’d configured was. I discovered that if I then changed it to the correct one, the next target I inspected was set to the one I’d just changed. In other words, all the targets were set, at least according to the dropdown, to the last one I’d modified.

After a lot of panicking, I realized that this was because, while I’d changed all the names of the *.xassets files, I’d left the default names of the assets (i.e., “LaunchImage”, “AppIcon”). If I gave these files unique names (i.e., “TargetALaunchImage”), however, the selection in the dropdown “stuck.”

I’m not sure if it was just the XCode UI that was messed up or if the wrong assets would have actually been used when archiving, but from now on I will be sure to give these assets unique names.