In swift 4 this fails
self.window.styleMask |= NSWindowStyleMask.fullSizeContentView
and I'd also like to undo
self.window.styleMask ^= NSWindowStyleMask.fullSizeContentView
as I would in objective-c
In swift 4 this fails
self.window.styleMask |= NSWindowStyleMask.fullSizeContentView
and I'd also like to undo
self.window.styleMask ^= NSWindowStyleMask.fullSizeContentView
as I would in objective-c
In Swift, NSWindowStyleMask
(in Swift 4, NSWindow.StyleMask
) is OptionSet
. You need to use methods defined for SetAlgebra
.
Swift 4:
self.window!.styleMask.formUnion(NSWindow.StyleMask.fullSizeContentView)
self.window!.styleMask.formSymmetricDifference(NSWindow.StyleMask.fullSizeContentView)
The code below compiles both in Swift 3 & Swift 4:
self.window!.styleMask.formUnion(.fullSizeContentView)
self.window!.styleMask.formSymmetricDifference(.fullSizeContentView)
This is ugly
self.window.styleMask = NSWindowStyleMask(rawValue: NSWindowStyleMask.fullSizeContentView.rawValue + panel.styleMask.rawValue)
seems to work? The net affect is the content shrinks (by title height) when it's toggled. So I might to back to what I had been using - .borderless