Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Change color theme based on target

I am developing an ipad app which will have two targets but color theme will be different for the targets e.g. in Target1 the selected button font color will be red and in Target2 the selected button font color will be green.I was wondering that is this feasible in interface builder itself?

Thanks in advance!!

like image 528
Desert Rose Avatar asked Oct 24 '25 15:10

Desert Rose


1 Answers

You can use preprocessor macros. Select your target, go to Build Settings section of the target, find Preprocessor Marcro and add new macro for each target (for example Target1 for your first target and Target2 for your second target). Now you can use code:

#ifdef Target1
  //code for your first target
#elif Target2
  //code for your second target
#endif

I hope it will help you ;-)

like image 69
Alien Avatar answered Oct 26 '25 05:10

Alien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!