Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C
7.6 KB
Raw Blame

Gestures

Source: https://developer.apple.com/design/human-interface-guidelines/gestures Section: Inputs Platforms covered: iOS, iPadOS, macOS (guidance specific to tvOS, visionOS, watchOS omitted) Last change on Apple's site: 2024-09-09 (Added guidance for working with system overlays in visionOS and made organizational updates.)

A gesture is a physical motion that a person uses to directly affect an object in an app or game on their device.


Depending on the device they’re using, people can make gestures on a touchscreen, in the air, or on a range of input devices such as a trackpad, mouse, remote, or game controller that includes a touch surface.

Every platform supports basic gestures like tap, swipe, and drag. Although the precise movements that make up basic gestures can vary per platform and input device, people are familiar with the underlying functionality of these gestures and expect to use them everywhere. For a list of these gestures, see Standard gestures.

Best practices

Give people more than one way to interact with your app. People commonly prefer or need to use other inputs — such as their voice, keyboard, or Switch Control — to interact with their devices. Don’t assume that people can use a specific gesture to perform a given task. For guidance, see Accessibility.

In general, respond to gestures in ways that are consistent with people’s expectations. People expect most gestures to work the same regardless of their current context. For example, people expect tap to activate or select an object. Avoid using a familiar gesture like tap or swipe to perform an action that’s unique to your app; similarly, avoid creating a unique gesture to perform a standard action like activating a button or scrolling a long view.

Handle gestures as responsively as possible. Useful gestures enhance the experience of direct manipulation and provide immediate feedback. As people perform a gesture in your app, provide feedback that helps them predict its results and, if necessary, communicates the extent and type of movement required to complete the action.

Indicate when a gesture isn’t available. If you don’t clearly communicate why a gesture doesn’t work, people might think your app has frozen or they aren’t performing the gesture correctly, leading to frustration. For example, if someone tries to drag a locked object, the UI may not indicate that the object’s position has been locked; or if they try to activate an unavailable button, the button’s unavailable state may not be clearly distinct from its available state.

Custom gestures

Add custom gestures only when necessary. Custom gestures work best when you design them for specialized tasks that people perform frequently and that aren’t covered by existing gestures, like in a game or drawing app. If you decide to implement a custom gesture, make sure it’s:

  • Discoverable
  • Straightforward to perform
  • Distinct from other gestures
  • Not the only way to perform an important action in your app or game

Make custom gestures easy to learn. Offer moments in your app to help people quickly learn and perform custom gestures, and make sure to test your interactions in real use scenarios. If you’re finding it difficult to use simple language and graphics to describe a gesture, it may mean people will find the gesture difficult to learn and perform.

Use shortcut gestures to supplement standard gestures, not replace them. While you may supply a custom gesture to quickly access parts of your app, people also need simple, familiar ways to navigate and perform actions, even if it means an extra tap or two. For example, in an app that supports navigation through a hierarchy of views, people expect to find a Back button in a top toolbar that lets them return to the previous view with a single tap. To help accelerate this action, many apps also offer a shortcut gesture — such as swiping from the side of a window or touchscreen — while continuing to provide the Back button.

Avoid conflicting with gestures that access system UI. Several platforms offer gestures for accessing system behaviors, like edge swiping in watchOS or rolling your hand over to access system overlays in visionOS. It’s important to avoid defining custom gestures that might conflict with these interactions, as people expect these controls to work consistently. In specific circumstances within games or immersive experiences, developers can work around this area by deferring the system gesture. For more information, see the platform considerations for iOS, iPadOS, watchOS, and visionOS.

Platform considerations

Mobile (iOS, iPadOS)

In addition to the standard gestures supported in all platforms, iOS and iPadOS support a few other gestures that people expect.

Gesture Common action
Three-finger swipe Initiate undo (left swipe); initiate redo (right swipe).
Three-finger pinch Copy selected text (pinch in); paste copied text (pinch out).
Four-finger swipe (iPadOS only) Switch between apps.
Shake Initiate undo; initiate redo.

Consider allowing simultaneous recognition of multiple gestures if it enhances the experience. Although simultaneous gestures are unlikely to be useful in nongame apps, a game might include multiple onscreen controls — such as a joystick and firing buttons — that people can operate at the same time. For guidance on integrating touchscreen input with Apple Pencil input in your iPadOS app, see Apple Pencil and Scribble.

Desktop (macOS)

People primarily interact with macOS using a keyboard and mouse. In addition, they can make standard gestures on a Magic Trackpad, Magic Mouse, or a game controller that includes a touch surface.

Specifications

Standard gestures

The system provides APIs that support the familiar gestures people use with their devices, whether they use a touchscreen, an indirect gesture in visionOS, or an input device like a trackpad, mouse, remote, or game controller. For developer guidance, see Gestures.

Gesture Supported in Common action
Tap iOS, iPadOS, macOS, tvOS, visionOS, watchOS Activate a control; select an item.
Swipe iOS, iPadOS, macOS, tvOS, visionOS, watchOS Reveal actions and controls; dismiss views; scroll.
Drag iOS, iPadOS, macOS, tvOS, visionOS, watchOS Move a UI element.
Touch (or pinch) and hold iOS, iPadOS, tvOS, visionOS, watchOS Reveal additional controls or functionality.
Double tap iOS, iPadOS, macOS, tvOS, visionOS, watchOS Zoom in; zoom out if already zoomed in; perform a primary action on Apple Watch Series 9 and Apple Watch Ultra 2.
Zoom iOS, iPadOS, macOS, tvOS, visionOS Zoom a view; magnify content.
Rotate iOS, iPadOS, macOS, tvOS, visionOS Rotate a selected item.

For guidance on supporting additional gestures and button presses on specific input devices, see Pointing devices, Remotes, and Game controls.

Change log

Date Changes
September 9, 2024 Added guidance for working with system overlays in visionOS and made organizational updates.
September 15, 2023 Updated specifications to include double tap in watchOS.
June 21, 2023 Changed page title from Touchscreen gestures and updated to include guidance for visionOS.

Related guidelines