Instance Method

press(forDuration:thenDragTo:)

Initiates a press-and-hold gesture, then drags to another element.

Declaration

func press(forDuration duration: TimeInterval, thenDragTo otherElement: XCUIElement)

Parameters

duration

Duration of the initial press-and-hold.

otherElement

The element to finish the drag gesture over. In the example of table cell reordering, this would be the reorder element of the destination row.

Discussion

This interaction is suitable for table cell reordering and similar operations.

See Also

Tapping and Pressing

func tap()

Sends a tap event to a hittable point computed for the element.

func doubleTap()

Sends a double tap event to a hittable point computed for the element.

func press(forDuration: TimeInterval)

Sends a long press gesture to a hittable point computed for the element, holding for the specified duration.