Gesture state is "transient" which means it will reset back to its initial state when user ends or cancels the gesture.
To update a viewas a gesture changes, add a GestureState property to your view and update it with updating(_: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.
// โญ๏ธ updates @GestureState var as the gestureโs value changes.// `updating($state){ value, state, transaction in ... }`funcupdating<State>(_state: GestureState<State>, body: @escaping ( Self.Value, // gesture's current valueinout State, // @GestureState var to be updatedinout Transaction // animation "context" (โ) ) ->Void) -> GestureStateGesture<Self, State>