Skip to content

Instantly share code, notes, and snippets.

@scottmkroberts
Created February 20, 2013 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scottmkroberts/5000305 to your computer and use it in GitHub Desktop.
Save scottmkroberts/5000305 to your computer and use it in GitHub Desktop.
Multiple Rounded corners with UIBezierPath using the | character
// Create the path (with only the top-left corner rounded)
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_categoryColorView.bounds
byRoundingCorners:UIRectCornerTopLeft |
UIRectCornerBottomLeft
cornerRadii:CGSizeMake(10.0, 10.0)];
// Create the shape layer and set its path
CAShapeLayer *maskLayerTop = [CAShapeLayer layer];
maskLayerTop.frame = _categoryColorView.bounds;
maskLayerTop.path = maskPath.CGPath;
_categoryColorView.layer.mask = maskLayerTop;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment