AppDelegate.swift

656 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)1011    if let button = statusItem.button {12      // Use a system symbol for the icon13      button.image = NSImage(14        systemSymbolName: "photo.on.rectangle.angled", accessibilityDescription: "Haven")15    }1617    // Initialize the menu controller18    menuController = MenuController(statusItem: statusItem)19  }20}