Skip to content

Instantly share code, notes, and snippets.

@hite

hite/round.m

Forked from larsacus/round.m
Created May 20, 2016
Embed
What would you like to do?
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