Hide close/minimize/maximize button in NSWindow
tommycarpi opened this issue · comments
tommycarpi commented
I've been trying to remove/hide the 3 top-left buttons of the view (close, minimize and maximize, but I stuck.
This is my current code, not working ...
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
#if targetEnvironment(macCatalyst)
Dynamic(self.view.window?.nsWindow).standardWindowButton(0).isHidden = true
Dynamic(self.view.window?.nsWindow).standardWindowButton(1).isHidden = true
Dynamic(self.view.window?.nsWindow).standardWindowButton(2).isHidden = true
#endif
}
Did anyone manage to solve this?
Miguel del Amor commented
You can achieve this over a NSWindow setting the style mask https://developer.apple.com/documentation/appkit/nswindow/stylemask