1

In my app I have a color.xcasset with following structure: color.xcasset

 ->Red
   ->primarycolor
   ->secondarycolor
   ->backgroundcolor
   ->headercolor
 ->Blue
   ->primarycolor
   ->secondarycolor
   ->backgroundcolor
   ->headercolor
 ->Yellow
   ->primarycolor
   ->secondarycolor
   ->backgroundcolor
   ->headercolor

Now I want to load only one folder at a time and that i will specify/select somewhere in app or in code. For example: When I choose to apply red theme to my app, it should load red folder. Same for blue and yellow themes. How I can do this?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Does it need to be swappable at run time? or will you compile the app with the theme being used – Fonix Mar 19 '19 at 07:29
  • maybe [this](https://stackoverflow.com/a/33285214/1219956) will solve your problem? keep the namespace as a variable somewhere and access your images like "\(theme)/imageName" – Fonix Mar 19 '19 at 07:38
  • @Fonix both, at runtime and build time. – Mohsin Khan Mar 19 '19 at 07:40

0 Answers0