Hey @Claude31, thanks for your help! It's now working if I do
@GestureState private var isPressed = false
...
let drag = DragGesture(minimumDistance: 0)
.updating($isPressed) { (value, gestureState, transaction) in
gestureState = true
}
return content
.gesture(drag)
.onChange(of: isPressed, perform: { (pressed) in
if pressed {
print("changed")
} else {
print("ended")
}
})
as suggested by someone else and also Apple. Here's the feedback Apple sent:
Thank you for filing this feedback report. We reviewed your report and determined the behavior you experienced is currently functioning as intended.
The gesture is cancelled in this case not ended (two fingers can't match a one-finger drag). You can use GestureState to handle the cancellation.
You can close this feedback by clicking on the "Close Feedback" link. Thank you.