This package lets you add support for user-customizable global keyboard shortcuts to your macOS app in minutes. It's fully sandbox and Mac App Store compatible. And it's used in production by Dato, Jiffy, Plash, and Lungo.
I'm happy to accept more configurability and features. PR welcome! What you see here is just what I needed for my own apps.
macOS 10.13+
Add https://github.com/sindresorhus/KeyboardShortcuts in the “Swift Package Manager” tab in Xcode.
First, register a name for the keyboard shortcut.
Constants.swift
import KeyboardShortcuts
extension KeyboardShortcuts.Name {
static let toggleUnicornMode = Self("toggleUnicornMode")
}

