Contents

Gestures

Define interactions from taps, clicks, and swipes to fine-grained gestures.

Overview

Respond to gestures by adding gesture modifiers to your views. You can listen for taps, drags, pinches, and other standard gestures.

[Image]

You can also compose custom gestures from individual gestures using the simultaneously(with:), sequenced(before:), or exclusively(before:) modifiers, or combine gestures with keyboard modifiers using the modifiers(_:) modifier.

For design guidance, see Gestures in the Human Interface Guidelines.

Topics

Essentials

Recognizing tap gestures

Recognizing long press gestures

Recognizing spatial events

Recognizing gestures that change over time

Recognizing Apple Pencil gestures

Combining gestures

Defining custom gestures

Managing gesture state

Handling activation events

Deprecated gestures

See Also

Event handling