Skip to content

Instantly share code, notes, and snippets.

@Uncommon
Last active February 7, 2017 19:13
Show Gist options
  • Save Uncommon/ca36550bdc4e9db606e70fc2f2e1223b to your computer and use it in GitHub Desktop.
Save Uncommon/ca36550bdc4e9db606e70fc2f2e1223b to your computer and use it in GitHub Desktop.
import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
let viewController = ViewController()
let window = NSWindow(contentRect: NSMakeRect(0, 0, NSScreen.main()!.frame.size.width, NSScreen.main()!.frame.size.height), styleMask: [.titled, .closable, .miniaturizable, .resizable], backing: NSBackingStoreType.buffered, defer: false)
func applicationDidFinishLaunching(_ aNotification: Notification) {
viewController.view = NSView(frame: NSMakeRect(0, 0, window.frame.size.width, window.frame.size.height))
viewController.view.wantsLayer = true
window.contentView!.addSubview(viewController.view)
window.makeKeyAndOrderFront(nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment