Swiftpack.co - hexedbits/StatusItemController as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by hexedbits.
hexedbits/StatusItemController 1.2.0
A "view controller" for menu bar Mac apps
⭐️ 59
🕓 2 weeks ago
macOS
.package(url: "https://github.com/hexedbits/StatusItemController.git", from: "1.2.0")

StatusItemController CI

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

  1. Subclass StatusItemController
  2. Implement the following methods:
    1. buildMenu() -> NSMenu
    2. leftClickAction()
    3. rightClickAction()
  3. Create an instance of your StatusItemController subclass in your NSApplicationDelegate.

Requirements

  • macOS 10.12+
  • Swift 5.5+
  • Xcode 13.0+
  • SwiftLint

Installation

CocoaPods

pod 'StatusItemController', '~> 1.0.0'

Swift Package Manager

Add StatusItemController to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/hexedbits/StatusItemController", from: "1.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.

GitHub

link
Stars: 59
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1.2.0
2 weeks ago

This release closes the 1.2.0 milestone.

Changes

  • Upgraded to Swift 5.5 and Xcode 13 (#27)
  • Various project infra updates (#27)
  • Added an example app project (#4)

Fixes

  • Resolved unit testing issue (#15)

Full Changelog: https://github.com/hexedbits/StatusItemController/compare/1.1.0...1.2.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics