Protocol

UIDragDropSession

The common interface for querying the state of both drag sessions and drop sessions.

Topics

Checking for Drag Items

func canLoadObjects(ofClass: NSItemProviderReading.Type) -> Bool

Returns a Boolean value that indicates whether at least one drag item in the session can create an instance of the specified class.

Required. Default implementation provided.

func hasItemsConforming(toTypeIdentifiers: [String]) -> Bool

Returns a Boolean value that indicates whether at least one drag item in the session conforms to at least one of the specified UTIs.

Required.

var items: [UIDragItem]

An array of drag items in the drag session or drop session.

Required.

Checking for Drag and Drop Session Restrictions

var allowsMoveOperation: Bool

A Boolean value that indicates whether the drag session permits moving drag items within the same app.

Required.

var isRestrictedToDraggingApplication: Bool

A Boolean value that indicates whether the drag session is confined to the app that started the drag activity.

Required.

Getting the Location of a Drag Activity

func location(in: UIView) -> CGPoint

Returns the geometrical location of the user’s drag activity within the specified view.

Required.

Relationships

Inherits From

See Also

Drag Sources

class UIDragItem

A representation of an underlying data item being dragged from one location to another.

protocol UIDragSession

The interface for configuring a drag session.

protocol UIDragAnimating

The interface for providing custom animation alongside the system's lift, drop, and cancellation animations.