I've implemented copying tableView selected cell value by shortcut cmd+C. Now I was trying to implement the pasting cmd+V. When I click on tableView cell, it gets selected. Another click, I'm editing it. While editing, I press cmd+V and nothing happens. I can write text but can't insert by copy-pasting.
Tried to implement it manually via Edit menu -> Paste Cmd+V.
@IBAction func onPaste(_ sender: Any) {
let pasteBoard = NSPasteboard.general
pasteBoard.declareTypes([NSPasteboard.PasteboardType.string], owner: nil)
tableView.selectedCell().set??? = pasteBoard.string(forType: NSPasteboard.PasteboardType.string)
}
But don't know how to set a value on NSCell.