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.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Declare a property as
@Gesture, pass as a binding to it as a parameter to a gesture’s
updating(_: callback, and receive updates to it. A property that’s declared as
@Gesture implicitly resets when the gesture becomes inactive, making it suitable for tracking transient state.
The following code snippet adds a long-press gesture to a circle, and declares the
is property as
@Gesture to update the interface while the user performs the gesture.