In my Mac OS X app I deleted all default menu items, added my own.
But in View
menu at the bottom I can still see Enter Full Screen
menu item,
For Swift 4
func applicationWillFinishLaunching(_ notification: Notification) {
UserDefaults.standard.set(false, forKey: "NSFullScreenMenuItemEverywhere")
}
The release notes for AppKit for 10.11 suggest you can use the NSUserDefault
NSFullScreenMenuItemEverywhere
.
Full Screen Menu Item
AppKit automatically creates an "Enter Full Screen" menu item after the application finishes launching if an equivalent menu item isn't found. If this menu item should not be created for your app, before NSApplicationDidFinishLaunchingNotification is sent you may set the NSFullScreenMenuItemEverywhere default to NO.
- (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
}