Skip to content

Commit 8491b52

Browse files
committed
[CustomKeyboard] Add enumerateKeyboardLayouts function
1 parent 3dba825 commit 8491b52

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Keyboard/DefaultKeyboard/CustomKeyboard.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,20 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
127127
return getKeyboardLayout(ofState: keyboardLayoutState)
128128
}
129129

130+
public func enumerateKeyboardLayouts(enumerate: (KeyboardLayout) -> Void) {
131+
let layouts = [
132+
keyboardLayout.uppercase,
133+
keyboardLayout.uppercaseToggled,
134+
keyboardLayout.lowercase,
135+
keyboardLayout.numbers,
136+
keyboardLayout.symbols,
137+
]
138+
139+
for layout in layouts {
140+
enumerate(layout)
141+
}
142+
}
143+
130144
public func keyboardLayoutStateDidChange(oldState oldState: CustomKeyboardLayoutState?, newState: CustomKeyboardLayoutState) {
131145
// Remove old keyboard layout
132146
if let oldState = oldState {

0 commit comments

Comments
 (0)