Search code examples
swiftmacoscocoa

Setting app.helpMenu is not displaying the help menu


I have a MacOS app that is written in Swift. It uses Cocoa and not SwiftUI. I want to setup a custom help menu. I don't have any help files and associated setting in Info.plist. This custom menu will have a link to a webpage and another action to show a list of navigation keys. I tried

app.helpMenu = helpMenu

where helpMenu contains the two actions. When I run the app, I don't see "Help" menu. I only see the rest of the mainMenu. Since it is a custom help anyway, I could just pretend it to be part of the mainMenu. But I am considering using the standard helpMenu feature as I may have help files bundled with the app in the future. How do I get it to work?


Solution

  • As @red_menace mentioned, in addition to setting app.helpMenu, it also needs to be added to the app.mainMenu.