Skip to content

Commit 0a00821

Browse files
committed
Add keyboardLayoutStyleDidChange
1 parent 025c24e commit 0a00821

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Keyboard/DefaultKeyboard/CustomKeyboard.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
2323
public var keyboardLayout: CustomKeyboardLayout!
2424
public var keyboardStyle = CustomKeyboardLayoutStyle() {
2525
didSet {
26-
keyboardLayout = CustomKeyboardLayout(style: keyboardStyle)
26+
keyboardLayoutStyleDidChange()
2727
}
2828
}
2929

30-
public weak var delegate: CustomKeyboardDelegate?
31-
3230
// MARK: CustomKeyobardShiftState
3331
public enum CustomKeyboardShiftState {
3432
case Once
@@ -79,6 +77,8 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
7977
}
8078
}
8179

80+
public weak var delegate: CustomKeyboardDelegate?
81+
8282
// MARK: Init
8383
public init() {
8484
super.init(frame: CGRect.zero)
@@ -96,7 +96,7 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
9696
}
9797

9898
private func defaultInit() {
99-
keyboardLayout = CustomKeyboardLayout(style: keyboardStyle)
99+
keyboardLayoutStyleDidChange()
100100
keyboardLayoutStateDidChange(oldState: nil, newState: keyboardLayoutState)
101101
}
102102

@@ -134,6 +134,10 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
134134
return getKeyboardLayout(ofState: keyboardLayoutState)
135135
}
136136

137+
public func keyboardLayoutStyleDidChange() {
138+
keyboardLayout = CustomKeyboardLayout(style: keyboardStyle)
139+
}
140+
137141
public func keyboardLayoutStateDidChange(oldState oldState: CustomKeyboardLayoutState?, newState: CustomKeyboardLayoutState) {
138142
// Remove old keyboard layout
139143
if let oldState = oldState {

0 commit comments

Comments
 (0)