镂空效果实现
UIImageView *guide_bg = [[UIImageView alloc]init];
guide_bg.frame = CGRectMake(0, 0, MooVW(bg), MooVH(bg));
guide_bg.image = [UIImage imageNamed:@"guide_bg"];//一张半透明黑灰背景图片
[bg addSubview:guide_bg];
UIBezierPath *bpath = [UIBezierPath bezierPathWithRoundedRect:guide_bg.frame cornerRadius:0];
// - bezierPathByReversingPath ,反方向绘制path
[bpath appendPath:[[UIBezierPath bezierPathWithRoundedRect:CGRectMake(guide_bg.frame.size.width/2-50, guide_bg.frame.size.height/2-50, 100, 100) cornerRadius:2] bezierPathByReversingPath]];
[bpath appendPath:[UIBezierPath bezierPathWithArcCenter:CGPointMake(guide_bg.frame.size.width/2-150, guide_bg.frame.size.height/2-50) radius:30 startAngle:0 endAngle:2*M_PI clockwise:NO]];
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.path = bpath.CGPath;
guide_bg.layer.mask = shapeLayer;