需求如上需要在View的左侧切割一个圆角,具体实现如下
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.jiFenBgView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(15, 15)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.view.bounds;
maskLayer.path = maskPath.CGPath;
self.view.layer.mask = maskLayer;
此外苹果还提供了如下的枚举值