4 ms·
> the app begins to significantly slow down due to the need to redraw every stroke continually. Why the continually? If the screen shows the result of drawing
by Someone 3y ago
> the app begins to significantly slow down due to the need to redraw every stroke continually.
Why the continually? If the screen shows the result of drawing all strokes, and the user draws a new one, you only need to draw that new one.
If redrawing gets slow, I would save both the strokes and their current rendering and, on redraw, just blit the rendering.
Also, in case you haven’t seen them: https://developer.apple.com/documentation/pencilkit https://developer.apple.com/documentation/pencilkit or the example code at https://developer.apple.com/documentation/pencilkit/drawing_with_pencilkit https://developer.apple.com/documentation/pencilkit/drawing_....
- bubobubobo 3y agoThanks for the great example of drawing stroke using UIKit! It was really helpful for refactoring my code. Also I figured out that another problem was the stroke saving logic(local & server) runs everytime I stroke. Thanks again for the comment.