๐ฐupdate gesture states
SwiftUI โฉ Gestures โฉ update gesture states
Gesture state is "transient" which means it will reset back to its initial state when user ends or cancels the gesture.
To update a view as a gesture changes, add a
GestureState
property to your view and update it withupdating(_:body:)
.SwiftUI invokes the updating callback as soon as it recognizes the gesture and whenever the value of the gesture changes.
SwiftUI doesnโt invoke the updating callback when the user ends or cancels a gesture. Instead, the gesture state property automatically resets its state back to its initial value.
Last updated