Reputation: 1312
I notice that when I use an asset catalog to specify my iOS app's icon, the resulting app has both an Assets.car file with the icons in it, as well as the individual icon files in the root bundle directory.
The app has iOS 9 as its deployment target.
I'm checking the resulting bundle by archiving the project and exporting it (via Xcode's Organizer window) as an Ad Hoc build with the App Thinning option set to iPhone 6s. This is on Xcode 9.3.1.
When I inspect the Assets.car file in the thinned app, I see that it only has the size 40, 58, 80, 114, and 120 icons (as well as a 200x178 image that the asset catalog viewer calls ZZZZPackedAsset-2.0 which contains 4 versions of the icon embedded in it which I've measured to be sizes: 42, 60, 82, and 116).
The icon files in the root bundle directory are the following:
So I have two questions:
Why are icon assets duplicated as external AppIcon*.png files and internal Assets.car assets?
Why do the individual AppIcon*.png include all of the icons and not just the ones need?
I was under the impression that iOS 9+ can use the asset catalog for its icon assets. Is this just a discrepancy in the bundle that Xcode produces versus what will happen on the app store? Or is it an incorrect assumption that I'm making about how the app thinning app export option works?
Upvotes: 3
Views: 1463
Reputation: 535229
With regard to the app icons, the asset catalog is a human labor-saving device, not a space-saving device.
Historically, there were not always asset catalogs; instead, the iOS system on the device expects to find the app icons at the top level of the app bundle, with highly specific names derived from a name specified in the Info.plist.
You could configure that yourself, and that's what we used to have to do.
But to save you the trouble of worrying about that, you are offered the option to put the app icons in the asset catalog instead — and then the app-building process does for you what you would previously have done yourself, writing the icons out to the top level of the app bundle and modifying the Info.plist to point to them.
Upvotes: 2