Last active
September 18, 2016 10:30
-
-
Save zld/db5bfe3c0a4361f97dc9e02153ac8ec9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)addRoundedCorners:(UIRectCorner)corners withRadii:(CGSize)radii { | |
CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
maskLayer.frame = self.bounds; | |
UIBezierPath *roundedPath = [UIBezierPath bezierPathWithRoundedRect: maskLayer.bounds byRoundingCorners:corners cornerRadii:radii]; | |
// maskLayer.fillColor = [[UIColor yellowColor] CGColor]; | |
maskLayer.backgroundColor = [[UIColor clearColor] CGColor]; | |
maskLayer.path = [roundedPath CGPath]; | |
self.layer.mask = maskLayer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment