I was wondering how can convert CGcolorRef to UIColor ? I have created a custom method for my own and I need it to use UIColor
EDITED method :
- (void)fontColor:(CGColorRef)colors setString(NSSTring *)blah blah blah {
coreTextLayer.foregroundColor = color;
}
[myClass fontColor:[UIColor redColor] setString....];
the right way is use something like this :
[UIColor redColor]CGColor];
but is there any way to use only UIColor?
Does
+ (UIColor *)colorWithCGColor:(CGColorRef)cgColornot do what you need?Follow-up:
Try implementing your method as something like:
(Adjusted to be more in line with Cocoa naming conventions, and to not use dot syntax. 😉