Add initializer to `KeyboardShortcuts.Recorder` that accepts a binding
sindresorhus opened this issue · 0 comments
sindresorhus commented
This would let developers use the recorder for custom use-cases when they don't need everything that comes with the Name
system. For example, support for local shortcuts.
import SwiftUI
import KeyboardShortcuts
struct SettingsScreen: View {
@State private var shortcut: KeyboardShortcuts.Shortcut?
var body: some View {
Form {
KeyboardShortcuts.Recorder("Toggle Unicorn Mode:", shortcut: $shortcut)
}
}
}
Also document how to use this to be able to use the recorder to record local shortcuts.