實現需求
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使用:
實現效果
實現代碼
鏈接請點擊獲取代碼