Skip to content

Instantly share code, notes, and snippets.

@hechen
Last active May 4, 2019 11:12
Show Gist options
  • Save hechen/d2cbde368d5a5f4918e3720753684245 to your computer and use it in GitHub Desktop.
Save hechen/d2cbde368d5a5f4918e3720753684245 to your computer and use it in GitHub Desktop.
NSStatusItem
let statusItem = NSStatusBar.system.statusItem(withLength:NSStatusItem.squareLength)
if let button = statusItem.button {
 button.image = NSImage(named:NSImage.Name("ic_dock"))
 button.action = #selector(doWhatYouWantToDo(_:))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment