tableView(_:acceptDrop:row:dropOperation:)
Called by aTableView when the mouse button is released over a table view that previously decided to allow a drop.
Declaration
@MainActor optional func tableView(_ tableView: NSTableView, acceptDrop info: any NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> BoolParameters
- 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
Discussion
The data source should incorporate the data from the dragging pasteboard in the implementation of this method. You can use the 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.
See Also
Drag and Drop
Supporting Table View Drag and Drop Through File PromisestableView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWith:)tableView(_:validateDrop:proposedRow:proposedDropOperation:)tableView(_:writeRowsWith:to:)tableView(_:draggingSession:willBeginAt:forRowIndexes:)tableView(_:updateDraggingItemsForDrag:)tableView(_:draggingSession:endedAt:operation:)