macOS Menu Bar

Xcode 16.2 Swift 6 macOS Sequoia 15.1 SwiftUI I am a beginner.

If I understand we can add buttons to the default Menu Bar but not delete them. Am I right? If you do not need most of the buttons, how do you solve that?

I can add a button: 
import SwiftUI

@main
struct NouMenuProvesApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
        .commands {
            CommandMenu("Custom") {
                Button("Custom Action") {
                    print("Custom Action performed")
                }
            }
        }
    }
}

Can I delete a Menu Button or create a new simpler Menu Bar?

You can remove some of the default menu items that don't make any sense for your app by replacing that group of commands with nothing at all, for example

CommandGroup(replacing: .textEditing) { }

however, if I remove all the text formatting commands,

CommandGroup(replacing: .textFormatting) { }

I still have a Format menu in the menu bar, but the menu has no content. I don't know how (in SwiftUI) you can entirely remove framework-provided menu items.

macOS Menu Bar
 
 
Q