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

# click(forDuration:thenDragTo:withVelocity:thenHoldForDuration:)

Clicks and holds for a duration, drags at a velocity, and holds over the other coordinate for a duration, all of which you specify.

## Declaration

```swift
func click(forDuration duration: TimeInterval, thenDragTo otherCoordinate: XCUICoordinate, withVelocity velocity: XCUIGestureVelocity, thenHoldForDuration holdDuration: TimeInterval)
```

## Parameters

- `duration`: The duration of the initial click and hold.
- `otherCoordinate`: The coordinate over which to finish the drag gesture.
- `velocity`: The speed at which to move from the initial click position to the other coordinate, expressed in pixels per second.
- `holdDuration`: The duration for which to hold over the other coordinate after dragging.

## See Also

### Clicking

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