背景:使用UIBezierPath 和 CAShapeLayer 画封闭图形
NSMutableArray *bezierPoints = [NSMutableArray array];
CGPathApply(path.CGPath, (__bridge void *)(bezierPoints), MyCGPathApplierFunc);
UIBezierPath *tessss = [[UIBezierPath alloc]init];
for (int i = 0 ;i<bezierPoints.count;i++) {
NSValue *pointValue = bezierPoints[i];
CGPoint point = [pointValue CGPointValue];
if (i==0) {
[tessss moveToPoint:point];
}else{
[tessss addLineToPoint:point];
}
XLogPoint1(point);
}
[tessss closePath];
self.penShapeView.shapeLayer.path &