Instance Method

dropInteraction(_:sessionDidUpdate:)

Tells the delegate the drop session has changed.

Declaration

optional func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal

Parameters

interaction

The interaction that called this method.

session

The drop session that has changed.

Return Value

A drop proposal that contains the operation the delegate intends to perform. You may return a proposal containing the move operation only if the session’s allowsMoveOperation is true.

Discussion

You must implement this method if the drop interaction’s view can accept drop activities. If you don’t provide this method, the view cannot accept any drop activities.

The interaction calls this method when one of the following happens:

  • The session enters the area of the drop interaction’s view.

  • The session moves inside the area of the drop interaction’s view.

  • The user adds a drag item to the session that within the area of the drop interaction’s view.

To get the location of the drop session after it has moved, call the session’s location(in:) method.

See Also

Tracking the Drop Movements

func dropInteraction(UIDropInteraction, sessionDidEnter: UIDropSession)

Tells the delegate the drop session has moved into the drop interaction’s view.

func dropInteraction(UIDropInteraction, sessionDidExit: UIDropSession)

Tells the delegate the drop session has moved out of the drop interaction’s view.

func dropInteraction(UIDropInteraction, sessionDidEnd: UIDropSession)

Tells the delegate the drop session has ended.