---
title: NSDraggingItem
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsdraggingitem
---

# NSDraggingItem

A single dragged item within a dragging session.

## Declaration

```swift
class NSDraggingItem
```

## Overview

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

- [init(pasteboardWriter:)](appkit/nsdraggingitem/init(pasteboardwriter:).md)

### Dragging frame

- [setDraggingFrame(_:contents:)](appkit/nsdraggingitem/setdraggingframe(_:contents:).md)
- [draggingFrame](appkit/nsdraggingitem/draggingframe.md)

### Drag image components

- [imageComponents](appkit/nsdraggingitem/imagecomponents.md)
- [imageComponentsProvider](appkit/nsdraggingitem/imagecomponentsprovider.md)
- [NSDraggingItem.ImageComponentKey](appkit/nsdraggingitem/imagecomponentkey.md)
- [item](appkit/nsdraggingitem/item.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Drag Sources

- [NSDraggingSource](appkit/nsdraggingsource.md)
- [NSDraggingSession](appkit/nsdraggingsession.md)
- [NSDraggingImageComponent](appkit/nsdraggingimagecomponent.md)
