Contents

NSDraggingItem

A single dragged item within a dragging session.

Declaration

class NSDraggingItem

Overview

NSDraggingItem objects have extremely limited lifetimes. Don’t retain these items because changing outside of the prescribed lifetimes has no impact on the drag.

When you call the NSDraggingSession method beginDraggingSession(with:event:source:), the system immediately consumes the dragging items that pass to the method, and doesn’t retain them. Any further changes to the dragging item associated with the returned NSDraggingSession must occur with the enumeration method enumerateDraggingItems(options:for:classes:searchOptions:using:). When enumerating, the system creates NSDraggingItem instances right before giving them to the enumeration block. After returning from the block, the dragging item is no longer valid.

Topics

Initializing a dragging item

Dragging frame

Drag image components

See Also

Drag Sources