Post

Replies

Boosts

Views

Activity

Reply to How to change a macOS menu title in SwiftUI
Hello: Now it is not possible to change the title of a menu in SwiftUI natively. However, you can use the application delegate for this purpose: you must first create the AppDelegate class and override the applicationDidFinishLaunching(_ : ) method. import cocoa class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ : Notification) { if let menu = NSApplication.shared.mainMenu?.item(withTitle: "Help") { NSApplication.shared.mainMenu?.removeItem(menu) } } } Then you have to set the application delegate in <application_name>App.swift with: @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate Before the body attribute. Greetings from Victor.-
Sep ’22