update
This commit is contained in:
1 parent
7e8be94530
commit
279ef707d5
1 file changed
+20
-3
@@ -258,11 +258,28 @@ import UIKit
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for (index, key) in keyStrings.enumerated() {
|
var validKeyStrings: [String] = []
|
||||||
print("Key \(index): \(key)")
|
|
||||||
|
for key in keyStrings {
|
||||||
|
if CommandManager.keyMappings.keys.contains(key) {
|
||||||
|
validKeyStrings.append(key)
|
||||||
|
} else {
|
||||||
|
print(" '\(key)' is not defined in key mappings")
|
||||||
|
return nil //treat any illegal string as a whole
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return keyStrings
|
if validKeyStrings.isEmpty {
|
||||||
|
print("No valid key strings found in the matched string")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for (index, key) in validKeyStrings.enumerated() {
|
||||||
|
print("Valid Key \(index): \(key)")
|
||||||
|
}
|
||||||
|
|
||||||
|
return validKeyStrings
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc public func addCommand(_ command: RemoteCommand) {
|
@objc public func addCommand(_ command: RemoteCommand) {
|
||||||
|
|||||||
Reference in new issue
Block a user