File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public class RxKeyboard: NSObject, RxKeyboardType {
57
57
width: UIScreen . main. bounds. width,
58
58
height: 0
59
59
)
60
- let frameVariable = Variable < CGRect > ( defaultFrame)
60
+ let frameVariable = BehaviorRelay < CGRect > ( value : defaultFrame)
61
61
self . frame = frameVariable. asDriver ( ) . distinctUntilChanged ( )
62
62
self . visibleHeight = self . frame. map { UIScreen . main. bounds. height - $0. origin. y }
63
63
self . willShowVisibleHeight = self . visibleHeight
@@ -115,8 +115,10 @@ public class RxKeyboard: NSObject, RxKeyboardType {
115
115
116
116
// merge into single sequence
117
117
Observable . of ( didPan, willChangeFrame, willHide) . merge ( )
118
- . bind ( to: frameVariable)
119
- . disposed ( by: self . disposeBag)
118
+ . subscribe ( onNext: { [ weak frameVariable] frame in
119
+ frameVariable? . accept ( frame)
120
+ } )
121
+ . disposed ( by: self . disposeBag)
120
122
121
123
// gesture recognizer
122
124
self . panRecognizer. delegate = self
You can’t perform that action at this time.
0 commit comments