I wish to have the following view respond to the magnification gestures, but it only works the first time. The view can be magnified as expected, but after the view is released, subsequent touches do not trigger the gesture.
Is there a way to have the gesture work continuously?
struct Card: View {
@State var magScale: CGFloat = 1
var magnification: some Gesture {
MagnificationGesture().onChanged { gesture in magScale = gesture }
}
var body: some View {
Rectangle()
.frame(width: 200, height: 200, alignment: .center)
.scaleEffect(self.magScale)
.gesture(magnification)
}
}
The view is used like so:
struct ContentView: View {
var body: some View {
ZStack {
Color.blue
Card()
}
}
}
