PKInk - no eraser stroke

I am trying to convert some of my older drawings to a PKCanvas. In my older drawings, I had an eraser stroke which erases anything that the stroke intersected with. I am able to convert all the strokes except an eraser stroke which doesn't seem to exist in PKCanvas. The user tool exists, but PKInkTypePen etc... doesn't contain an eraser type.

Is there any way to create an "eraser type stroke" so I can convert my drawing strokes to use the PKCanvas?

Thanks

Answered by DTS Engineer in 823976022

Add eraser like drawing to your PKDrawing using the mask property of PKStroke. You can create these masks using the CGPath API. A good way to create an eraser mask is using the CGPath copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:) method.

Accepted Answer

Add eraser like drawing to your PKDrawing using the mask property of PKStroke. You can create these masks using the CGPath API. A good way to create an eraser mask is using the CGPath copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:) method.

PKInk - no eraser stroke
 
 
Q