Created
September 30, 2014 16:27
-
-
Save abrewing/9f77922515538f4085b9 to your computer and use it in GitHub Desktop.
Round only the corners that you want
This file contains hidden or 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
UIBezierPath *maskPath; | |
maskPath = [UIBezierPath bezierPathWithRoundedRect:<#view#>.bounds | |
byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) | |
cornerRadii:CGSizeMake(<#width#>, <#height#>)]; | |
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | |
maskLayer.frame = <#view#>.bounds; | |
maskLayer.path = maskPath.CGPath; | |
<#view#>.layer.mask = maskLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment