实现需求
1:两条相近的直线计算角度,并且合在一起
2:上一根有角度的不与下一根计算
3:角度显示要保存,撤销的时候清除
实现方法
1:Touch Method
-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent *)event;
-(void)touchesMoved:(NSSet*)touches withEvent:(UIEvent *)event;
-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent *)event;
2:CALayerDelegate
-(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx;
3:UIBezierPath使用:
实现效果
实现代码
链接请点击获取代码