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


class UIDragItem : NSObject


Initializing a Drag Item

init(itemProvider: NSItemProvider)

Initializes a new drag item with a specified item provider.

Accessing the Drag Item's Data

var itemProvider: NSItemProvider

The item provider associated with the drag item.

var localObject: Any?

A custom object associated with the drag item.

Changing the Drag Item Preview

var previewProvider: (() -> UIDragPreview?)?

A visual preview of the drag item, displayed while the user drags the item across the screen.


Inherits From

Conforms To

See Also

Drag Sources

protocol UIDragDropSession

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

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.