Instance Method


Returns a Boolean value that indicates whether a drag operation is allowed.


optional func tableView(_ tableView: NSTableView, writeRowsWith rowIndexes: IndexSet, to pboard: NSPasteboard) -> Bool



The table view that sent the message.


An index set of row numbers that will be participating in the drag.


The pasteboard to which to write the drag data.

Return Value

YES if the drag operation is allowed, NO otherwise.


Called by aTableView after it has been determined that a drag should begin, but before the drag has been started.

To refuse the drag, return false. To start a drag, return true and place the drag data onto pboard (data, owner, and so on). The drag image and other drag-related information will be set up and provided by the table view once this call returns with true.

See Also

Drag and Drop

func tableView(NSTableView, acceptDrop: NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> Bool

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

func tableView(NSTableView, namesOfPromisedFilesDroppedAtDestination: URL, forDraggedRowsWith: IndexSet) -> [String]

Returns an array of filenames that represent the indexSet rows for a drag to dropDestination.

func tableView(NSTableView, updateDraggingItemsForDrag: NSDraggingInfo)

Implement this method to allow the table to update dragging items as they are dragged over a view.