Skip to content

Instantly share code, notes, and snippets.

@hite
Forked from larsacus/round.m
Created May 20, 2016 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hite/9094b8f41d0659118bf7050fec4b09d7 to your computer and use it in GitHub Desktop.
Save hite/9094b8f41d0659118bf7050fec4b09d7 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