Xcode & Swift - Window without title bar but with close, minimize and resize buttons Xcode & Swift - Window without title bar but with close, minimize and resize buttons swift swift

Xcode & Swift - Window without title bar but with close, minimize and resize buttons


The new window style mask NSFullSizeContentViewWindowMask added in OS X 10.10 will do the trick.

self.window.titleVisibility = NSWindowTitleVisibility.Hidden;self.window.titlebarAppearsTransparent = YES;self.window.styleMask |= NSFullSizeContentViewWindowMask;

Release Notes


Since MacOS X 10.10, you can use these:

if #available(macOS 10.10, *) {    window.titlebarAppearsTransparent = true}if #available(macOS 10.2, *) {    window.movableByWindowBackground  = true}

There was an official sample project for window appearance in Yosemite. You might wanna check it out.


For Swift 3 :-

self.window.titleVisibility = .hiddenself.window.titlebarAppearsTransparent = trueself.window.styleMask.insert(.fullSizeContentView)