UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 30)];
// image.image = [UIImage imageNamed:@"newfeatures0"];
image.backgroundColor = [UIColor redColor];
[self.view addSubview:image];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:image.bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(8, 8)];
CAShapeLayer *layer = [[CAShapeLayer alloc] init];
layer.path = maskPath.CGPath;
image.layer.mask = layer;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRect:image.bounds];
[maskPath appendPath:[UIBezierPath bezierPathWithRoundedRect:image.bounds cornerRadius:10]];
CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
shapeLayer.path = maskPath.CGPath;
// shapeLayer.frame = image.bounds;
shapeLayer.fillColor = [UIColor whiteColor].CGColor;
shapeLayer.fillRule = kCAFillRuleEvenOdd;
[image.layer addSublayer:shapeLayer];