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

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

Initiates a press-and-hold gesture, drags to another coordinate with a velocity you specify, and holds for a duration you specify.

## Declaration

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

## Parameters

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

## Discussion

Discussion This method is available in iOS and for Touch Bar interactions in macOS.

## See Also

### Tapping and pressing

- [tap()](xcuiautomation/xcuicoordinate/tap().md)
- [doubleTap()](xcuiautomation/xcuicoordinate/doubletap().md)
- [press(forDuration:)](xcuiautomation/xcuicoordinate/press(forduration:).md)
- [press(forDuration:thenDragTo:)](xcuiautomation/xcuicoordinate/press(forduration:thendragto:).md)
