AppDelegate.swift

699 B · raw

1import AppKit23class AppDelegate: NSObject, NSApplicationDelegate {4    var statusItem: NSStatusItem!5    var menuController: MenuController!67    func applicationDidFinishLaunching(_ notification: Notification) {8        // Create the status item in the menu bar9        statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)10        11        if let button = statusItem.button {12            // Use a system symbol for the icon13            button.image = NSImage(systemSymbolName: "photo.on.rectangle.angled", accessibilityDescription: "Haven")14        }1516        // Initialize the menu controller17        menuController = MenuController(statusItem: statusItem)18    }19}