Last active
May 4, 2019 11:12
-
-
Save hechen/d2cbde368d5a5f4918e3720753684245 to your computer and use it in GitHub Desktop.
NSStatusItem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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