Skip to content

Commit 63f6377

Browse files
authored
Merge pull request #107 from yongseongkim/master
The visibleHeight's output is wrong when 'Reduce Motion' and 'Prefer Cross-Fade Transitions' are on.
2 parents c532cc3 + 9c72dc3 commit 63f6377

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/RxKeyboard/RxKeyboard.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class RxKeyboard: NSObject, RxKeyboardType {
6363
)
6464
let frameVariable = BehaviorRelay<CGRect>(value: defaultFrame)
6565
self.frame = frameVariable.asDriver().distinctUntilChanged()
66-
self.visibleHeight = self.frame.map { UIScreen.main.bounds.height - $0.origin.y }
66+
self.visibleHeight = self.frame.map { UIScreen.main.bounds.intersection($0).height }
6767
self.willShowVisibleHeight = self.visibleHeight
6868
.scan((visibleHeight: 0, isShowing: false)) { lastState, newVisibleHeight in
6969
return (visibleHeight: newVisibleHeight, isShowing: lastState.visibleHeight == 0 && newVisibleHeight > 0)

0 commit comments

Comments
 (0)