Shows an NSPopover from the status bar. Works with Mission Control and Spaces. Supports dark mode.
platform :osx, '10.10'
use_frameworks!
pod 'PopStatusItem'
github 'adamhartford/PopStatusItem'
let popStatusItem = PopStatusItem(image: NSImage(named: "buttonImage")!)
func applicationDidFinishLaunching(aNotification: NSNotification) {
let storyboard = NSStoryboard(name: "Main", bundle: nil)
popStatusItem.windowController = storyboard.instantiateControllerWithIdentifier("PopStatusItem") as? NSWindowController
}
// Manual actions
popStatusItem.togglePopover()
popStatusItem.showPopover()
popStatusItem.hidePopover()
popStatusItem.highlight = true // Highlights status bar icon. Default is false.
popStatusItem.activate = true // Makes popover window active. Default is false.
Usage, or to recreate the demo application:
PopDatePicker is released under the MIT license. See LICENSE for details.