How to add UIImageView to PKDrawing and get it as data

I have a question about an app using PencilKit. I would like to add a UIImageView that is addSubviewed on top of PKCanvasView to PKDrawing and retrieve it as data along with other drawing information using dataRepresentation(). Please tell me how.

Replies

Hello,

It's not completely clear to me what you are trying to achieve, are you trying to get the drawing rendered as a UIImage? If so, have you tried the image(from:scale:) method?