跳转至
Protocol

Gesture

An instance that matches a sequence of events to a gesture, and returns a stream of values for each of its states.

Declaration

protocol Gesture

Overview

Create custom gestures by declaring types that conform to the Gesture protocol.

Availability

iOS 13.0+

macOS 10.15+

tvOS 13.0+

watchOS 6.0+

Topics


Instance Property

body The content and behavior of the gesture.


Instance Method

exclusively(before:) Combines two gestures exclusively to create a new gesture where only one gesture succeeds, giving precedence to the first gesture.

map(_:) Returns a gesture that's the result of mapping the given closure over the gesture.

onChanged(_:) Adds an action to perform when the gesture's value changes.

onEnded(_:) Adds an action to perform when the gesture ends.

sequenced(before:) Sequences a gesture with another one to create a new gesture, which results in the second gesture only receiving events after the first gesture succeeds.

simultaneously(with:) Combines a gesture with another gesture to create a new gesture that recognizes both gestures at the same time.

updating(_:body:) Updates the provided gesture state property as the gesture's value changes.


Associated Type

Body The type of gesture representing the body of Self.

Value The type representing the gesture's value.