//  from StackOverflow

CAShapeLayer *layer = [CAShapeLayer layer];

UIBezierPath *linePath = [UIBezierPath bezierPath];

 

[linePath moveToPoint: pointA];

[linePath addLineToPoint: pointB];

line.path = linePath.CGPath;

line.fillColor = nil;

line.opacity = 1.0;

line.strokeColor = [UIColor redColor].CGColor;

[layer addSublayer:line];

posted on 2015-04-27 14:42  ximenchuixie  阅读(1562)  评论(0编辑  收藏  举报