I have code that does custom rendering inside of a drawRect method in a UIView subclass. I am trying to render text out using [NSString drawInRect]
which works great, however it always shows up in white. After much googling and browsing SO I have no been able to find out how to change the color of a text. Any advice would be great.
Edit Below is the snippet of code inside my drawRect implementation
if(self.state != UIControlStateHighlighted)
{
CGContextSaveGState(context);
CGContextSetFillColorWithColor(context, color);
CGContextSetShadowWithColor(context, CGSizeMake(0, 2), 3.0, shadowColor);
CGContextAddPath(context, path);
CGContextFillPath(context);
[title drawInRect:rect withFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
CGContextRestoreGState(context);
}