I Use this function to draw a custom UILabel. It works with iOS 6 and earlier but fails with iOS 7. If I replace CGContextSetStrokeColorWithColor with CGContextSetFillColorWithColor, it works with iOS7 but not with 6 and earlier.
void ShadowedStrokedText(CGContextRef ctx,NSString *text,CGPoint textStartPont,UIColor *textColor,UIFont *font,CGFloat lineWidth,UIColor * shadowColor,CGFloat shadowThickness){
CGContextSaveGState(ctx);
CGContextSetInterpolationQuality(ctx,kCGInterpolationHigh);
CGContextSetLineJoin(ctx, kCGLineJoinRound);
CGContextSetLineWidth(ctx, lineWidth);
CGContextSetStrokeColorWithColor(ctx, textColor.CGColor);
//---this works with iOS7
//CGContextSetFillColorWithColor(ctx, textColor.CGColor);
CGContextSetTextDrawingMode(ctx, kCGTextStroke);
CGContextSetShadowWithColor(ctx,CGSizeMake(0,0),shadowThickness,[shadowColor CGColor]);
[text drawAtPoint:textStartPont withFont:font];
CGContextRestoreGState(ctx);}
why?