Loading different Asset Catalogs based on Build Configuration?

663 views Asked by At

I'm working on an app that has a LOT of artwork that changes between build configurations. Sort of like the "STG" and "PROD" versions of the AppIcon that a lot of apps use for development, only it's dozens of images throughout the app.

Right now, all those images are stored together in a single Asset Catalog, with names based on the build configuration, like so:

-Image1_dev
-Image1_qa
-Image1_stg
-Image1_prod
-Image2_dev
-Image2_qa
-Image2_stg
-Image2_prod

And that works fine, except for one thing: it seems like a waste to quadruple the filesize of each app, since all four versions contain the art assets for the other three.

So, is there a way to have multiple Asset Catalogs, and only build the one you need for that build configuration? Something equivalent to the common macro:

#ifdef DEBUG
 // debug code goes here
#endif

...but for loading asset catalogs? So there could be DEV, QA, STG, and PROD catalogs, each with 50 assets, rather than a single catalog with 200, and any given build only includes the single relevant catalog?

0

There are 0 answers