I want to define a global color that I can reuse for the downstream state for various user ui cells.
Not sure if this is the right way to do this, but ..
I defined a class called lightGreyUIColor that has this .h file -
and this. m file -
#import "lightGreyUIColor.h" @implementation lightGreyUIColor + (UIColor*)lightGreyBGColor { return [UIColor colorWithRed:241.0/255.0 green:241/255.0 blue:241/255.0 alpha:1]; } @end
I included the lightGreyUIColor.h file in the implementation file to represent the table and tried to refer to it as folows -
cell.backgroundColor = [UIColor lightGreyBGColor];
What just gives rise to an unknown class or method error for lightgreyBGColor, where I am wrong, and is there a better way to implement a global style than this?
source share