Possible Duplicate:
Objective C defining UIColor constants
I’d like to use few colours throughout my app. Instead of creating a UIColor at every instance or in every viewController is there a way by which i can use it throughout the app.
or is it wise to use a ColourConstants.h header file where i #define each colour i want to use
i.e
#define SCARLET [UIColor colorWithRed:207.0/255.0 green:47.0/255.0 blue:40.0/255.0 alpha:1];
thanks in advance!
I would use a category on UIColor. For example:
And when you want to use the color you only have to do this:
Hope it helps!!