<!--
{
  "availability" : [
    "Xcode: 16.3.0 -",
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "XCUIAutomation",
  "identifier" : "/documentation/XCUIAutomation/XCUICoordinate/click(forDuration:thenDragTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XCUIAutomation"
    ],
    "preciseIdentifier" : "c:objc(cs)XCUICoordinate(im)clickForDuration:thenDragToCoordinate:"
  },
  "title" : "click(forDuration:thenDragTo:)"
}
-->

# click(forDuration:thenDragTo:)

Clicks and holds for a duration you specify, then drags to the other coordinate.

```
func click(forDuration duration: TimeInterval, thenDragTo otherCoordinate: XCUICoordinate)
```

## Parameters

`duration`

The duration of the initial click and hold.

`otherCoordinate`

The coordinate over which to finish the drag gesture.

---

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)