import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

  var window: NSWindow?

  func applicationDidFinishLaunching(_ notification: Notification) {
    window = NSWindow()
    window?.styleMask = [.borderless]
    window?.makeKeyAndOrderFront(nil)
  }
}

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

  @IBOutlet weak var window: NSWindow!


  func applicationDidFinishLaunching(_ aNotification: Notification) {
    // Insert code here to initialize your application
  }

  func applicationWillTerminate(_ aNotification: Notification) {
    // Insert code here to tear down your application
  }
}

--- 
+++ 
@@ -3,14 +3,11 @@
 @NSApplicationMain
 class AppDelegate: NSObject, NSApplicationDelegate {
 
-  @IBOutlet weak var window: NSWindow!
+  var window: NSWindow?
 
-
-  func applicationDidFinishLaunching(_ aNotification: Notification) {
-    // Insert code here to initialize your application
-  }
-
-  func applicationWillTerminate(_ aNotification: Notification) {
-    // Insert code here to tear down your application
+  func applicationDidFinishLaunching(_ notification: Notification) {
+    window = NSWindow()
+    window?.styleMask = [.borderless]
+    window?.makeKeyAndOrderFront(nil)
   }
 }
Refactor applicationDidFinishLaunching to draw a small window on the screen
