Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created December 19, 2011 17:02
Show Gist options
  • Select an option

  • Save codeswimmer/1497988 to your computer and use it in GitHub Desktop.

Select an option

Save codeswimmer/1497988 to your computer and use it in GitHub Desktop.
iOS: How to draw shadowed text
// How to draw shadowed text
// color = [[UIColor orangeColor] CGColor]; best to cache this
CGContextSaveGState(context);
CGFloat shadowHeight = 2.0;
CGContextSetShadowWithColor(context, CGSizeMake(1.0, -shadowHeight), 0.0, <color>);
[<string>, drawInRect:<rect> withFont:<font>];
CGContextRestoreGState(context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment