Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing content in PencilKit

When using PencilKit in iOS 13/iPadOS, how do you remove all content from the screen, or remove those content selected (via lasso)?

I can't find any functions in PKDrawing or PKCanvasView that do these?

like image 512
Lim Thye Chean Avatar asked Oct 21 '25 17:10

Lim Thye Chean


1 Answers

You can clear the drawing on the PKCanvasView by simply setting the drawing property equal to a new empty PKDrawing.

canvasView.drawing = PKDrawing()
like image 165
Jordan H Avatar answered Oct 24 '25 07:10

Jordan H



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!