---
title: "click(forDuration:thenDragTo:)"
framework: xcuiautomation
role: symbol
role_heading: Instance Method
path: "xcuiautomation/xcuicoordinate/click(forduration:thendragto:)"
---

# click(forDuration:thenDragTo:)

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

## Declaration

```swift
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.

## See Also

### Clicking

- [click()](xcuiautomation/xcuicoordinate/click().md)
- [click(forDuration:thenDragTo:withVelocity:thenHoldForDuration:)](xcuiautomation/xcuicoordinate/click(forduration:thendragto:withvelocity:thenholdforduration:).md)
- [doubleClick()](xcuiautomation/xcuicoordinate/doubleclick().md)
- [rightClick()](xcuiautomation/xcuicoordinate/rightclick().md)
