Reputation: 131
I need to remove this option in my app
This is my app delegate:
import AppKit
public class AppDelegate: NSObject, NSApplicationDelegate {
public func applicationWillTerminate(_ aNotification: Notification) {
MainViewModel.shared.saveSettings()
}
public func applicationDidFinishLaunching(_ notification: Notification) {
for window in NSApp.windows {
var style = window.styleMask
style.remove(.resizable)
window.styleMask = style
window.standardWindowButton(.zoomButton)?.isHidden = true
}
}
public func applicationWillFinishLaunching(_ notification: Notification) {
NSWindow.allowsAutomaticWindowTabbing = false
}
}
How can i do this?
Upvotes: 4
Views: 1328
Reputation: 131
Just add the commands modifier to WindowGroup, as here:
WindowGroup {
MainView().frame(width: 300, height: 95)
}.commands {
CommandGroup(replacing: CommandGroupPlacement.newItem) {
}
}
Upvotes: 8