Skip to content

Instantly share code, notes, and snippets.

@gonsolo
gonsolo / HelloWindow.swift
Last active April 21, 2022 18:13
Swift 4 macOS Window Hello World
// Hello World Window macOS Swift 4: Creates an empty window
import AppKit
let nsapp = NSApplication.shared
let rect = NSMakeRect(0, 0, 200, 200)
if #available(macOS 10.10, *) {
let window = NSWindow(contentRect: rect,
styleMask: .fullSizeContentView,
backing: NSWindow.BackingStoreType.buffered,