A simple way to draw smooth line on iOS.
- Change stroke color
- Change stroke width
- Undo
- Clear all drawings
- Eraser drawing
- Get snapshot
Just dragging WTBezierPath and WTDrawingView into projects, then do what you want.
self.drawingView = [[WTDrawingView alloc] initWithFrame:self.view.bounds];[self.drawingView undo];[self.drawingView clear];self.drawingView.eraserMode = YES;Default stroke width is 2.0.
self.drawingView.strokeWidth = 5.0;Default stroke color is black.
self.drawingView.strokeColor = [UIColor redColor];Default eraser width is 20.
self.drawingView.eraserWidth = 20.0f;