StatusItemController
A "view controller" for menu bar Mac apps
Install / Use
/learn @hexedbits/StatusItemControllerREADME
StatusItemController 
A "view controller" for menu bar Mac apps
About
This library provides a StatusItemController component that you can use to create menu bar apps, or apps with menu bar items in macOS.
This component is used in Red Eye and Lucifer.
Usage
- Subclass
StatusItemController - Implement the following methods:
buildMenu() -> NSMenuleftClickAction()rightClickAction()
- Create an instance of your
StatusItemControllersubclass in yourNSApplicationDelegate.
Requirements
- macOS 11.0+
- Swift 5.9+
- Xcode 15.0+
- SwiftLint
Installation
CocoaPods
pod 'StatusItemController', '~> 2.0.0'
Swift Package Manager
Add StatusItemController to the dependencies value of your Package.swift.
dependencies: [
.package(url: "https://github.com/hexedbits/StatusItemController", from: "2.0.0")
]
Alternatively, you can add the package directly via Xcode.
Documentation
You can read the documentation here. Generated with jazzy. Hosted by GitHub Pages.
Notes on Testing
Unfortunately, StatusItemController cannot be tested directly. Attempting to create an NSStatusItem outside of an app context throws an assert, which makes sense. Thus, in order to test StatusItemController it must be embedded in an app. Tests can be found in the Example App test suite. See #15 for more details.
Contributing
Interested in making contributions to this project? Please review the guides below.
Also consider sponsoring this project or buying my apps! ✌️
Credits
Created and maintained by Jesse Squires.
License
Released under the MIT License. See LICENSE for details.
Copyright © 2020-present Jesse Squires.
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
