Protocol

UIDragInteractionDelegate

The interface for configuring and controlling a drag interaction.

Topics

Performing the Drag

func dragInteraction(UIDragInteraction, itemsForBeginning: UIDragSession)

Asks the delegate for the array of drag items for an impending drag interaction.

Required.

func dragInteraction(UIDragInteraction, itemsForAddingTo: UIDragSession, withTouchAt: CGPoint)

Asks the delegate for the drag items to add to an in-progress drag session, in response to a user gesture to add the items.

func dragInteraction(UIDragInteraction, sessionForAddingItems: [UIDragSession], withTouchAt: CGPoint)

Asks the delegate which drag session to add drag items to when there is more than one in-progress session.

Animating the Drag Behaviors

func dragInteraction(UIDragInteraction, item: UIDragItem, willAnimateCancelWith: UIDragAnimating)

Tells the delegate the system's cancellation animation is about to start.

Monitoring Drag Progress

func dragInteraction(UIDragInteraction, sessionWillBegin: UIDragSession)

Tells the delegate the lift animation has finished and the user is starting to move the items across the screen.

func dragInteraction(UIDragInteraction, session: UIDragSession, willAdd: [UIDragItem], for: UIDragInteraction)

Tells the delegate an interaction is about to add items to a drag session.

func dragInteraction(UIDragInteraction, sessionDidMove: UIDragSession)

Tells the delegate the user moved the drag items to a new location on the screen.

func dragInteraction(UIDragInteraction, session: UIDragSession, willEndWith: UIDropOperation)

Tells the delegate the drag activity will end with the specified operation.

func dragInteraction(UIDragInteraction, session: UIDragSession, didEndWith: UIDropOperation)

Tells the delegate the drag activity and its related animations have finished.

func dragInteraction(UIDragInteraction, sessionDidTransferItems: UIDragSession)

Tells the delegate the destination view has received the data for the drag items.

Providing Drag Previews

func dragInteraction(UIDragInteraction, previewForLifting: UIDragItem, session: UIDragSession)

Asks the delegate for the targeted drag item preview that will appear during the lift animation.

func dragInteraction(UIDragInteraction, previewForCancelling: UIDragItem, withDefault: UITargetedDragPreview)

Asks the delegate for the targeted drag item preview to show during the cancellation animation.

func dragInteraction(UIDragInteraction, prefersFullSizePreviewsFor: UIDragSession)

Asks the delegate whether the preview should appear in its original size or a scaled size.

Restricting the Drag Behavior

func dragInteraction(UIDragInteraction, sessionIsRestrictedToDraggingApplication: UIDragSession)

Asks the delegate whether the system should restrict the drag session to the app that started the session.

func dragInteraction(UIDragInteraction, sessionAllowsMoveOperation: UIDragSession)

Asks the delegate whether the session allows the move operation.

Relationships

Inherits From

See Also

Drag-and-Drop Interactions

protocol UIDropInteractionDelegate

The interface for configuring and controlling a drop interaction.

protocol UIInteraction

The interface for attaching a gesture-based behavior to a view, such as to express a drag, drop, or spring-loaded interaction.

class UIDragInteraction

An interaction to enable dragging of items from a view, employing a delegate to provide drag items and to respond to calls from the drag session.

class UIDropInteraction

An interaction to enable dropping of items onto a view, employing a delegate to instantiate objects and respond to calls from the drop session.