I am new to macOS development. None of the above solutions worked for me (Swift 4.2). I also didn't learn that much (copy/paste doesn't help with that).
I have created this NSWindow subclass. I use it in Interface builder.
class MainDocumentChooserW: NSWindow {
// NOTE: This method is called when the Window is used via Interface builder.
// Setting the styleMask like this will override the IB settings.
override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
styleMask = [.miniaturizable, .titled, .closable]
}
}
Tested on macOS: High Sierra 10.13.6 (17G5019).