Rasterize a SwiftUI view into an image.
import Raster
let view = ... any SwiftUI view
let image = view.rasterize(at: size)
dependencies: [
.package(url: "https://github.com/alexito4/Raster.git", from: "0.0.1")
],
...
.target(
dependencies: [
"Raster"
],
),
Alejandro Martinez | http://alejandromp.com | @alexito4