Contents

press(forDuration:thenDragTo:withVelocity:thenHoldForDuration:)

Initiates a press-and-hold gesture, drags to another element at a velocity, and holds for a duration, all of which you specify.

Declaration

func press(forDuration duration: TimeInterval, thenDragTo otherElement: XCUIElement, withVelocity velocity: XCUIGestureVelocity, thenHoldForDuration holdDuration: TimeInterval)

Parameters

  • duration:

    The duration of the initial press-and-hold gesture.

  • otherElement:

    The element over which to finish the drag gesture.

  • 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 the dragged element over the other element.

See Also

Tapping and pressing