- (void)showWithView:(UIView *)fromView inContainer:(UIView *)container {
CGRect fromRect = [fromView convertRect:fromView.bounds toView:self];
//获取整块画布path
UIBezierPath *bpath = [UIBezierPath bezierPathWithRect:self.bounds];
//贝塞尔曲线 画出了镂空区域
//这边需要注意的是 , 如果想保留圆以外的部分 , clockwise (顺时针方向) 要选为NO , 如果想保留矩形以外的部分 , 矩形需要反方向绘制path .
[bpath appendPath:[[UIBezierPath bezierPathWithRoundedRect:fromRect cornerRadius:6] bezierPathByReversingPath]];

//创建一个CAShapeLayer 图层
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.path = bpath.CGPath;

//添加图层蒙板
self.maskview.layer.mask = shapeLayer;

[container addSubview:self]; }