Here's how you can create a masking path:
- (UIBezierPath *)curvedRectWithFrame:(CGRect)frame radius:(CGFloat)radius { double halfFrameHeight = ((double)frame.size.height / 2);
Then you can apply a shape mask to your image:
const CGFloat kCurveRadius = 500.; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = yourImageView.bounds; maskLayer.path = [self curvedRectWithFrame:maskLayer.bounds radius:kCurveRadius].CGPath; yourImageView.layer.mask = maskLayer;
yurish
source share