PKCanvasView and document based App

I created a document based app with SwiftUI and a PKCanvasView.
Now I want to save the drawings of the PKCanvasView inside of the file.
How can I do this?

PKCanvasView and document based App
 
 
Q