Contents

onTapGesture(count:coordinateSpace:inputKinds:perform:)

Adds an action to perform when this view recognizes a tap gesture, and provides the action with the location of the interaction.

Declaration

nonisolated func onTapGesture(count: Int = 1, coordinateSpace: some CoordinateSpaceProtocol = .local, inputKinds: GestureInputKinds = .all, perform action: @escaping (CGPoint) -> Void) -> some View

Parameters

  • count:

    The number of taps or clicks required to trigger the action closure provided in action.

  • coordinateSpace:

    The coordinate space in which to receive location values.

  • inputKinds:

    A set of input kinds that this gesture recognizes. If not specified, the gesture will recognize all applicable input kinds that a person can use to perform it.

  • action:

    The action to perform. This closure receives an input that indicates where the interaction occurred.

See Also

Recognizing tap gestures