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?
Asked
Active
Viewed 161 times
2
-
`PKCanvasView` has a `drawing` property, which in turn has a `dataRepresentation()` method that gives you data you can save to a file. – jnpdx Jan 26 '22 at 22:48
-
@jnpdx How can I do this? Do you know a good tutorial? Or can you tell it me? – SwiftIsGreat Jan 26 '22 at 23:16
-
I can, but it would be helpful to see your attempt and where you got stuck -- then I'll know what the structure of your code looks like. – jnpdx Jan 27 '22 at 00:56
-
@jnpdx I asked a new [question](https://stackoverflow.com/questions/70883267/turn-data-of-pkcanvasview-in-datarepresentation-and-save-it-to-custom-file) with some code and I hope you can answer it. – SwiftIsGreat Jan 27 '22 at 17:44