I have a class:
class MyDockTilePlugin: NSObject, NSDockTilePlugIn {
func setDockTile(_ dockTile: NSDockTile?) { return }
func dockMenu() -> NSMenu? {
let menu = NSMenu()
let it = NSMenuItem(title: "choose me!", action: #selector(self.selectDMIP(_:)), keyEquivalent: "")
it.target = self
menu.addItem(it)
return menu
}
@objc func selectDMIP(_ sender: NSMenuItem) {
print("you selected me!")
}
}
and I follow the instructions to put it in a Bundle and copy it into the main app.
I run the main app. Change the Dock options to Keep in Dock. Quit the main app. Right-click the Dock icon. I get the menu, but when selected, it never prints "you selected me!"
What I do see after selecting the menu item is the plugin class reloading.
Any ideas how to capture the menu item selection?