I'm trying to make a simple drawing app in swift, iOS.
So i've managed to draw using Path(). Now i want to save an image of what i've drawn.
I have found on apple docs that ImageRenderer() is the thing to use nowadays. But i can't seem to make it work with Path().
This renders just fine:
let renderer = ImageRenderer(content: Text("3"))
This doesn't:
let renderer = ImageRenderer(content: Path { path in
path.addLines(lines)
}.stroke(lineWidth: 5.0))
I've spent 3 days now with different methods and hacks, but nothing really works?
Why is it that cant render a path, which is a View with swifts ImageRenderer?