manwholikesspritekit
manwholikesspritekit

Reputation: 351

Create plain box window like this in Swift?

Below is a screenshot of the 'Squish' app on the App Store. How am I able to make a window like that, with rounded corners and no separator between the titlebar and content?

The only difference is I want to have a title on the title bar.

So in short, how do make a window like in the image but with a title?

enter image description here

Upvotes: 3

Views: 1304

Answers (1)

Eric Aya
Eric Aya

Reputation: 70113

Create a new NSWindow in Xcode, then create an outlet for it, and set the titlebarAppearsTransparent property to true:

@IBOutlet weak var windowBlank: NSWindow!

func applicationDidFinishLaunching(aNotification: NSNotification) {
    windowBlank.titlebarAppearsTransparent = true
    windowBlank.backgroundColor = NSColor.whiteColor()
} 

You also have to enable the Full size content view checkbox in the Attributes inspector.

enter image description here

Upvotes: 4

Related Questions