Quick Tip : Borderless Windows in Swift

If you create a swift dialog from an NSWindow, and it needs to contain TextFields

YOU MUST have “.titled” in the stylemask! (yes, even if there is no titlebar)

If not, the textfields cannot have their delegates set and it will just beep

  let win = NSWindow(
            contentRect : NSRect(x: 0, y: 0, width: 600, height: 930),
            styleMask   :  [.borderless,.titled,.docModalWindow],
            backing     : .buffered,
            defer       : false
        )

how curios