Hello,
I would like to add copy (Command + C) functionality to my NSTableView for a row (or multiple rows) that the user has selected.
I've tried adding in the NSTableViewController the following things with no luck, the copy function (Command + C) always appears greyed out in the menu:
1.
override func copy() -> AnyObject {
print("TEST: copytriggered") /*Here i would copy to clipboard the selected rows*/
return true
}
2.
Conforming to NSCopying, implementing copyWithZone...
3.
Trying 1 and 2 in the window controller and app delegate.
4.
Adding func tableView(_ tableView: NSTableView, pasteboardWriterForRow row: Int) -> NSPasteboardWriting? in the TableView data source.
I have no clue what to do at this point, any help appreciated.
Thanks,
Marc