A property wrapper type that updates a property while the user performs a gesture and resets the property back to its initial state when the gesture ends.
Mac Catalyst 13.0+
Declare a property as @GestureState, pass as a binding to it as a parameter to a gesture’s updating(_:body:) callback, and receive updates to it. A property that’s declared as @GestureState implicitly resets when the gesture becomes inactive, making it suitable for tracking transient state.
Add a long-press gesture to a Circle, and update the interface during the gesture by declaring a property as GestureState: