Skip to content

Instantly share code, notes, and snippets.

@larsacus
Created December 16, 2011 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save larsacus/1487166 to your computer and use it in GitHub Desktop.
Save larsacus/1487166 to your computer and use it in GitHub Desktop.
Round corner without clipsToBounds
// Clips the bottom left corner to a radius
CGSize cornerSize = CGSizeMake(10,10);
UIBezierPath *roundRectMaskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds
byRoundingCorners:UIRectCornerBottomLeft
cornerRadii:cornerSize];
CAShapeLayer *roundRectMaskLayer = [CAShapeLayer layer];
roundRectMaskLayer.frame = self.view.bounds;
roundRectMaskLayer.path = roundRectMaskPath.CGPath;
view.layer.mask = roundRectMaskLayer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment