<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/LongPressGesture/init(minimumDuration:maximumDistance:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI16LongPressGestureV15minimumDuration15maximumDistanceACSd_14CoreFoundation7CGFloatVtcfc"
  },
  "title" : "init(minimumDuration:maximumDistance:)"
}
-->

# init(minimumDuration:maximumDistance:)

Creates a long-press gesture with a minimum duration and a maximum
distance that the interaction can move before the gesture fails.

```
nonisolated init(minimumDuration: Double = 0.5, maximumDistance: CGFloat = 10)
```

## Parameters

`minimumDuration`

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

`maximumDistance`

The maximum distance that the fingers or cursor
performing the long press can move before the gesture fails.

---

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)