I have SwiftUI app with storyboard menu where I added my own item which is disabled when I run the app. I created following class to make it enabled and I call initMenu method from applicationDidFinishLaunching in AppDelegate but menu item still remains disabled, what else or additional I have to do to make it enabled?
class MenuActions: NSObject {
func initMenu() {
let mainMenu = NSApplication.shared.mainMenu
mainMenu?.autoenablesItems = false
mainMenu?.item(at: 1)?.submenu?.item(at: 0)?.isEnabled = true
}
@IBAction func new(_ sender: NSMenuItem) {
print("fired")
}
}

