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

# tableView(_:acceptDrop:row:dropOperation:)

Called by `aTableView` when the mouse button is released over a table view that previously decided to allow a drop.

```
@MainActor optional func tableView(_ tableView: NSTableView, acceptDrop info: any NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> Bool
```

## Parameters

`tableView`

The table view that sent the message.

`info`

An object that contains more information about this dragging operation.

`row`

The index of the proposed target row.

`dropOperation`

The type of dragging operation.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the drop operation was successful, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The data source should incorporate the data from the dragging pasteboard in the implementation of this method. You can use the [`draggingPasteboard`](/documentation/AppKit/NSDraggingInfo/draggingPasteboard) method to get the data for the drop operation from `info`.

To accept a drop on the second row, `row` would be 2 and `operation` would be `NSTableViewDropOn`. To accept a drop below the last row, `row` would be `[aTableView numberOfRows]` and `operation` would be `NSTableViewDropAbove`.

---

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)