Class

NSDraggingItem

A single dragged item within a dragging session.

Declaration

@interface NSDraggingItem : NSObject

Overview

NSDraggingItem objects have extremely limited lifetimes. Do not retain these items as changing outside of the prescribed lifetimes have no impact on the drag.

When the NSDraggingSession method beginDraggingSessionWithItems:event:source: is called, the dragging items passed to the method are consumed immediately and are not retained. Any further changes to the dragging item associated with the returned NSDraggingSession must be done via the enumeration method enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:. When enumerating, NSDraggingItem instances are created right before being given to the enumeration block. After returning from the block, the dragging item is no longer valid.

Topics

Initializing a Dragging Item

- initWithPasteboardWriter:

Initializes and returns a dragging item using the specified content.

Dragging Frame

- setDraggingFrame:contents:

Sets the item’s dragging frame and contents.

draggingFrame

Returns the frame of the dragging item.

Drag Image Components

imageComponents

Returns an array of dragging image components that are used to create the drag image.

imageComponentsProvider

An array of blocks that provide the dragging image components.

item

Returns the pasteboard reader or writer object dependent on the context of where this dragging item is used .

Relationships

Inherits From

See Also

Drag Sources

NSDraggingSource

A set of methods that are implemented by the source object in a dragging session.

NSDraggingSession

The encapsulation of a drag-and-drop action that supports modification of the drag while in progress.

NSDraggingImageComponent

A single object in a dragging item.