PopStatusItem 0.5.0

PopStatusItem 0.5.0

Tests 已测试
Lang 语言 Swift Swift
许可证 MIT
Released最近发布2016年11月
SwiftSwift版本3.0
SPM支持SPM

Adam Hartford维护。



PopStatusItem

从状态栏显示NSPopover。与Mission Control和Spaces兼容。支持暗黑模式。

Screenshot

安装

CocoaPods

platform :osx, '10.10'
use_frameworks!

pod 'PopStatusItem'

Carthage

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.

使用或重新创建示例应用

  1. 将LSUIElement=YES添加到Info.plist中。
  2. 在Main.storyboard窗口控制器中取消选中“Is Initial Controller”。

许可证

PopDatePicker使用MIT许可证发布。有关详细信息,请参阅LICENSE。