Posts

Post not yet marked as solved
0 Replies
70 Views
I was able to implement drag and drop with NSTableViewDiffableDataSource by subclassing and adding the missing methods. It works but the draggingSession willBeginAt method is never called so I can't provided a custom preview to the dragging. Any tips from AppKit developers or Apple engineers? class ListCoordinator: NSTableViewDiffableDataSource<String, Int>, NSTableViewDelegate {     @objc func tableView(_ tableView: NSTableView, pasteboardWriterForRow row: Int) -> NSPasteboardWriting? {         return NSPasteboardItem(pasteboardPropertyList: row.formatted(), ofType: .string)     }     @objc func tableView(_ tableView: NSTableView, validateDrop info: NSDraggingInfo, proposedRow row: Int, proposedDropOperation dropOperation: NSTableView.DropOperation) -> NSDragOperation {         return .move     }     @objc func tableView(_ tableView: NSTableView, acceptDrop info: NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> Bool { ...         return true     }          @objc func tableView(_ tableView: NSTableView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forRowIndexes rowIndexes: IndexSet) {         // NEVER CALLED     }      }
Posted Last updated
.
Post not yet marked as solved
1 Replies
178 Views
Does any one know why onDelete method uses an IndexSet for delete operation? I couldn't find any way to delete more than one row from a List.
Posted Last updated
.