Skip to content

Commit

Permalink
Update Recorder.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus authored Jan 14, 2024
1 parent 9e6300d commit 926089a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Sources/KeyboardShortcuts/Recorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,25 +130,25 @@ extension KeyboardShortcuts.Recorder<Text> {

@available(macOS 10.15, *)
extension KeyboardShortcuts.Recorder<Text> {
/**
- Parameter title: The title of the keyboard shortcut recorder, describing its purpose.
- Parameter name: Strongly-typed keyboard shortcut name.
- Parameter onChange: Callback which will be called when the keyboard shortcut is changed/removed by the user. This can be useful when you need more control. For example, when migrating from a different keyboard shortcut solution and you need to store the keyboard shortcut somewhere yourself instead of relying on the built-in storage. However, it's strongly recommended to just rely on the built-in storage when possible.
*/
@_disfavoredOverload
public init(
_ title: String,
name: KeyboardShortcuts.Name,
onChange: ((KeyboardShortcuts.Shortcut?) -> Void)? = nil
) {
self.init(
for: name,
onChange: onChange,
hasLabel: true
) {
Text(title)
}
}
/**
- Parameter title: The title of the keyboard shortcut recorder, describing its purpose.
- Parameter name: Strongly-typed keyboard shortcut name.
- Parameter onChange: Callback which will be called when the keyboard shortcut is changed/removed by the user. This can be useful when you need more control. For example, when migrating from a different keyboard shortcut solution and you need to store the keyboard shortcut somewhere yourself instead of relying on the built-in storage. However, it's strongly recommended to just rely on the built-in storage when possible.
*/
@_disfavoredOverload
public init(
_ title: String,
name: KeyboardShortcuts.Name,
onChange: ((KeyboardShortcuts.Shortcut?) -> Void)? = nil
) {
self.init(
for: name,
onChange: onChange,
hasLabel: true
) {
Text(title)
}
}
}

@available(macOS 10.15, *)
Expand Down

0 comments on commit 926089a

Please sign in to comment.