I have a constants.m file, which is a centralized set of many program constants. To set the color, I do this:
@implementation UIColor (UIColor_Constants) +(UIColor *) defaultResultTableBackgroundColor{ //return [[UIColor colorWithRed:0.6f green:0.004f blue:0.0f alpha:1.0f] retain]; return [[UIColor colorWithRed:0.1f green:0.004f blue:0.3f alpha:0.3f] retain]; } +(UIColor *) defaultResultHeaderBackgroundColor{ return [[UIColor clearColor] retain]; } @end
and in constants. I have
@interface UIColor (UIColor_Constants) +(UIColor *) defaultResultTableBackgroundColor; +(UIColor *) defaultResultHeaderBackgroundColor; @end
and then just use [UIColor defaultResultTableBackgroundColor] , where I want to refer to this constant.
I would like to have some other UIColor and UIFont constants, and although this works, it seems more complicated than it should be. Is there an easier way to do this?
source share