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

# press(forDuration:thenDragTo:)

Initiates a press-and-hold gesture at the coordinate, then drags to another coordinate.

## Declaration

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

## Parameters

- `duration`: The duration of the initial press-and-hold gesture.
- `otherCoordinate`: The coordinate to finish the drag gesture over.

## 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:withVelocity:thenHoldForDuration:)](xcuiautomation/xcuicoordinate/press(forduration:thendragto:withvelocity:thenholdforduration:).md)
