---
title: "init(pasteboardWriter:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsdraggingitem/init(pasteboardwriter:)"
---

# init(pasteboardWriter:)

Creates and returns a dragging item using the specified content.

## Declaration

```swift
init(pasteboardWriter: any NSPasteboardWriting)
```

## Parameters

- `pasteboardWriter`: The object that provides the dragging content. The object must implement the doc://com.apple.appkit/documentation/AppKit/NSPasteboardWriting protocol.

## Return Value

Return Value An initialized NSDraggingItem instance with the specified dragging content.

## Discussion

Discussion When the developer creates an NSDraggingItem instance , it is for use with the view method beginDraggingSession(with:event:source:) During the invocation of that method, the pasteboardWriter is placed onto the dragging pasteboard for the NSDraggingSession that contains the dragging item instance. The designated initializer.
