I want to set the Zoom scale of my PKCanvasView()
I tried adding this function:
func setCanvasZoom() {
canvasView.zoomScale = 2.0
print("CanvasView: \(canvasView.zoomScale)")
}
But that function always throws 1.0
in the console...
I am calling the setCanvasView()
function, after my ScrollView
appeared:
ZStack {
ScrollView {
VStack {
CanvasView(canvasView: $canvasView)
}
}.onAppear(perform: {
setCanvasZoom()
})
}
The canvasView
variable is declared like that:
@State var canvasView = PKCanvasView()
Do you guys have any Idea why this happens?