<!--
{
  "availability" : [
    "tvOS: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/onLongTouchGesture(minimumDuration:perform:onTouchingChanged:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE18onLongTouchGesture15minimumDuration7perform0D15TouchingChangedQrSd_yycySbcSgtF"
  },
  "title" : "onLongTouchGesture(minimumDuration:perform:onTouchingChanged:)"
}
-->

# onLongTouchGesture(minimumDuration:perform:onTouchingChanged:)

Adds an action to perform when this view recognizes a
remote long touch gesture. A long touch gesture is when the finger is
on the remote touch surface without actually pressing.

```
nonisolated func onLongTouchGesture(minimumDuration: Double = 0.5, perform action: @escaping () -> Void, onTouchingChanged: ((Bool) -> Void)? = nil) -> some View
```

## Parameters

`minimumDuration`

The minimum duration of the long touch that must
elapse before the gesture succeeds.

`action`

The action to perform when a long touch is recognized

`onTouchingChanged`

A closure to run when the touching state of
the gesture changes, passing the current state as a parameter.

---

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)