<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableViewDataSource/tableView(_:pasteboardWriterForRow:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTableViewDataSource(im)tableView:pasteboardWriterForRow:"
  },
  "title" : "tableView(_:pasteboardWriterForRow:)"
}
-->

# tableView(_:pasteboardWriterForRow:)

Called to allow the table to support multiple item dragging.

```
@MainActor optional func tableView(_ tableView: NSTableView, pasteboardWriterForRow row: Int) -> (any NSPasteboardWriting)?
```

## Parameters

`tableView`

The table view.

`row`

The row.

## Return Value

Returns an instance of [`NSPasteboardItem`](/documentation/AppKit/NSPasteboardItem) or a custom object that implements the [`NSPasteboardWriting`](/documentation/AppKit/NSPasteboardWriting) protocol. Returning `nil` excludes the row from being dragged.

## Discussion

This method is required for multi-image dragging.

If this method is implemented, then [`tableView(_:writeRowsWith:to:)`](/documentation/AppKit/NSTableViewDataSource/tableView(_:writeRowsWith:to:)) will not be called.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)