<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/handGestureShortcut(_:isEnabled:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE19handGestureShortcut_9isEnabledQrAA04HandeF0V_SbtF"
  },
  "title" : "handGestureShortcut(_:isEnabled:)"
}
-->

# handGestureShortcut(_:isEnabled:)

Assigns a hand gesture shortcut to the modified control.

```
nonisolated func handGestureShortcut(_ shortcut: HandGestureShortcut, isEnabled: Bool = true) -> some View
```

## Parameters

`shortcut`

The shortcut to associate with this control.

`isEnabled`

A Boolean value that indicates whether the shortcut is
is enabled for this control.

## Discussion

Performing the control’s shortcut while the control is anywhere in the
frontmost scene is equivalent to direct interaction with the control to
perform its primary action.

The following example lets users of a watchOS music app toggle playback
by double-tapping their thumb and index finger together:

```
struct PlaybackControls: View {
    let model: TrackModel

    var body: some View {
        HStack {
            Button("Skip Back") {
                model.skipBack()
            }

            Button("Play/Pause") {
                model.playPause()
            }
            .handGestureShortcut(.primaryAction)

            Button("Skip Forward") {
                model.skipForward()
            }
        }
    }
}
```

The target of a hand gesture shortcut is resolved in a
leading-to-trailing traversal of the active scene.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)