@@ -23,12 +23,10 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
23
23
public var keyboardLayout : CustomKeyboardLayout !
24
24
public var keyboardStyle = CustomKeyboardLayoutStyle ( ) {
25
25
didSet {
26
- keyboardLayout = CustomKeyboardLayout ( style : keyboardStyle )
26
+ keyboardLayoutStyleDidChange ( )
27
27
}
28
28
}
29
29
30
- public weak var delegate : CustomKeyboardDelegate ?
31
-
32
30
// MARK: CustomKeyobardShiftState
33
31
public enum CustomKeyboardShiftState {
34
32
case Once
@@ -79,6 +77,8 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
79
77
}
80
78
}
81
79
80
+ public weak var delegate : CustomKeyboardDelegate ?
81
+
82
82
// MARK: Init
83
83
public init ( ) {
84
84
super. init ( frame: CGRect . zero)
@@ -96,7 +96,7 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
96
96
}
97
97
98
98
private func defaultInit( ) {
99
- keyboardLayout = CustomKeyboardLayout ( style : keyboardStyle )
99
+ keyboardLayoutStyleDidChange ( )
100
100
keyboardLayoutStateDidChange ( oldState: nil , newState: keyboardLayoutState)
101
101
}
102
102
@@ -134,6 +134,10 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
134
134
return getKeyboardLayout ( ofState: keyboardLayoutState)
135
135
}
136
136
137
+ public func keyboardLayoutStyleDidChange( ) {
138
+ keyboardLayout = CustomKeyboardLayout ( style: keyboardStyle)
139
+ }
140
+
137
141
public func keyboardLayoutStateDidChange( oldState oldState: CustomKeyboardLayoutState ? , newState: CustomKeyboardLayoutState ) {
138
142
// Remove old keyboard layout
139
143
if let oldState = oldState {
0 commit comments