Contents

dragInteraction(_:itemsForAddingTo:forTouchAt:completion:)

Requests items to add to a drag session.

Declaration

optional func dragInteraction(_ dragInteraction: BEDragInteraction, itemsForAddingTo session: any UIDragSession, forTouchAt point: CGPoint, completion: @escaping ([UIDragItem]) -> Bool)

Parameters

  • dragInteraction:

    The drag interaction that invokes this method.

  • session:

    An in-progress drag session to which to add items.

  • point:

    The touch location in the view’s coordinate system.

  • completion:

    A completion handler that you call to add items to the drag session.

Discussion

This method is the asynchronous variant of dragInteraction(_:itemsForAddingTo:withTouchAt:). If your delegate implements this method, the system calls this method instead of the synchronous version.

Call the completion handler as soon you prepare its arguments. The system times out the completion handler if a long delay occurs before you call the handler.

The completion block returns true if the drag session added the items you supplied, and false otherwise.

See Also

Participating in drag gestures