mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove the coordinator dependency from KeyboadManager as it wasn't needed
This commit is contained in:
@@ -17,19 +17,9 @@ enum KeyboardType: String {
|
||||
|
||||
class KeyboardManager {
|
||||
|
||||
private let coordinator: SceneCoordinator
|
||||
private(set) var keyCommands: [UIKeyCommand]?
|
||||
|
||||
init(type: KeyboardType, coordinator: SceneCoordinator) {
|
||||
self.coordinator = coordinator
|
||||
load(type: type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private extension KeyboardManager {
|
||||
|
||||
func load(type: KeyboardType) {
|
||||
init(type: KeyboardType) {
|
||||
let file = Bundle.main.path(forResource: type.rawValue, ofType: "plist")!
|
||||
let entries = NSArray(contentsOfFile: file)! as! [[String: Any]]
|
||||
keyCommands = entries.compactMap { createKeyCommand(keyEntry: $0) }
|
||||
@@ -44,6 +34,10 @@ private extension KeyboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private extension KeyboardManager {
|
||||
|
||||
func createKeyCommand(keyEntry: [String: Any]) -> UIKeyCommand? {
|
||||
guard let input = createKeyCommandInput(keyEntry: keyEntry) else { return nil }
|
||||
let modifiers = createKeyModifierFlags(keyEntry: keyEntry)
|
||||
|
||||
Reference in New Issue
Block a user