Skip to content

Instantly share code, notes, and snippets.

@yaozhuoyu
yaozhuoyu / gist:6405550
Created September 1, 2013 16:32 — forked from ksm/gist:1869980
/*
Source: Apple Developer - Understanding iOS View Compositing
Note: setting view.layer.cornerRadius and .masksToBounds
sends the view for rending to an offscreen buffer.
We want to avoid unnecessary rendering passes.
Let the context do the work.
*/
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx {
CGRect rect = layer.bounds;