Skip to content

Instantly share code, notes, and snippets.

@chancyWu
Created February 6, 2014 03:28
Show Gist options
  • Save chancyWu/8837982 to your computer and use it in GitHub Desktop.
Save chancyWu/8837982 to your computer and use it in GitHub Desktop.
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 200, 200) byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(10.0, 10.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = CGRectMake(0, 0, 200, 200);
maskLayer.path = maskPath.CGPath;
self.imageView.layer.mask = maskLayer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment