Remove the coordinator dependency from KeyboadManager as it wasn't needed

This commit is contained in:
Maurice Parker
2019-09-05 14:37:07 -05:00
parent 988ec75d75
commit 73828e5115
5 changed files with 9 additions and 15 deletions

View File

@@ -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)