@@ -56,21 +56,11 @@ open class KeyboardLayoutGuide: UILayoutGuide {
56
56
guard let view = owningView else {
57
57
return
58
58
}
59
-
60
- if #available( iOS 11 . 0 , * ) {
61
- NSLayoutConstraint . activate ( [
62
- heightAnchor. constraint ( equalToConstant: Keyboard . shared. currentHeight) ,
63
- leftAnchor. constraint ( equalTo: view. leftAnchor) ,
64
- rightAnchor. constraint ( equalTo: view. rightAnchor) ,
65
- ] )
66
- } else {
67
- NSLayoutConstraint . activate ( [
68
- heightAnchor. constraint ( equalToConstant: 0 ) ,
69
- leftAnchor. constraint ( equalTo: view. leftAnchor) ,
70
- rightAnchor. constraint ( equalTo: view. rightAnchor) ,
71
- ] )
72
- }
73
-
59
+ NSLayoutConstraint . activate ( [
60
+ heightAnchor. constraint ( equalToConstant: Keyboard . shared. currentHeight) ,
61
+ leftAnchor. constraint ( equalTo: view. leftAnchor) ,
62
+ rightAnchor. constraint ( equalTo: view. rightAnchor) ,
63
+ ] )
74
64
let viewBottomAnchor : NSLayoutYAxisAnchor
75
65
if #available( iOS 11 . 0 , * ) {
76
66
viewBottomAnchor = view. safeAreaLayoutGuide. bottomAnchor
@@ -88,9 +78,7 @@ open class KeyboardLayoutGuide: UILayoutGuide {
88
78
}
89
79
heightConstraint? . constant = height
90
80
animate ( note)
91
- if #available( iOS 11 . 0 , * ) {
92
- Keyboard . shared. currentHeight = height
93
- }
81
+ Keyboard . shared. currentHeight = height
94
82
}
95
83
}
96
84
0 commit comments