I didn't use storyboard and xib, just used only code. I would like to add "Edit" Menu Programmatically. My Questions are
1) How to show "Edit" Menu / What codes need to input at comment Question 1)?
2) There are any actions provided from swift like copy & paste?
class TestManager: NSObject {
// ....
override init() {
let editMenuItems = [
NSMenuItem(title: "Cut", action: nil(/* Question 2) */), keyEquivalent: ""),
NSMenuItem(title: "Copy", action: nil, keyEquivalent: ""),
NSMenuItem(title: "Paste", action: nil, keyEquivalent: ""),
]
for editMenuItem in editMenuItems {
self.editMenu.addItem(editMenuItem)
}
// Qustion 1) .. show "Edit" Menu
}
}