I'm using the following code to add a new menu item programatically
override func viewDidLoad() {
let mainMenu = NSApp.mainMenu
let myMenu = NSMenuItem(title: "MenuTitle", action: nil, keyEquivalent: "")
mainMenu!.addItem(myMenu)
}
But this does not add a new menu item.