Is there a SwiftUI idiomatic way to selectively remove the defualt (File, Edit, and View) menus from the menu bar in a macOS app, while keeping other menus like the AppName menu intact? The app I’m building is a simple utility, so Edit and View menus are not relevant in this context.
I’m aware of the new .commandsRemoved(), available since macOS 13, but that apparently removes all menus.
I’m looking for a pure SwiftUI solution. Any guidance and help would be appreciated.
You could try removing all commands using
.commandsRemoved(), then adding back only the ones you want. You can also show/hide the particularcommandusing a condition.