Skip to content

Instantly share code, notes, and snippets.

@abrewing
Created September 30, 2014 16:27
Show Gist options
  • Save abrewing/9f77922515538f4085b9 to your computer and use it in GitHub Desktop.
Save abrewing/9f77922515538f4085b9 to your computer and use it in GitHub Desktop.
Round only the corners that you want
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