// 可用枚举
// typedef NS_OPTIONS(NSUInteger, UIRectCorner) {
// UIRectCornerTopLeft = 1 << 0,
// UIRectCornerTopRight = 1 << 1,
// UIRectCornerBottomLeft = 1 << 2,
// UIRectCornerBottomRight = 1 << 3,
// UIRectCornerAllCorners = ~0UL
// };
float imageH = self.frame.size.height - 30;
self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, imageH)];
self.imageView.backgroundColor = [UIColor whiteColor];
self.imageView.image = [UIImage imageNamed:@"group-12"];
[self addSubview:self.imageView];
//上两角,下两角与此方式相同
UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:self.imageView.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
maskLayer1.frame = self.imageView.bounds;
maskLayer1.path = maskPath1.CGPath;
self.imageView.layer.mask = maskLayer1;