From de9831f579978a506d00f1c960c477d505753fb9 Mon Sep 17 00:00:00 2001 From: Aleksei Cherepanov Date: Thu, 31 Oct 2019 19:04:35 +0300 Subject: [PATCH] CGFloat comparison issue I've realised that on iPhone XS Max you can get >0 height of the hidden keyboard. So better compare keyboard height with epsilon nether than 0 --- Sources/RxKeyboard/RxKeyboard.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/RxKeyboard/RxKeyboard.swift b/Sources/RxKeyboard/RxKeyboard.swift index 9563576..e33d36e 100644 --- a/Sources/RxKeyboard/RxKeyboard.swift +++ b/Sources/RxKeyboard/RxKeyboard.swift @@ -77,7 +77,7 @@ public class RxKeyboard: NSObject, RxKeyboardType { } .filter { state in state.isShowing } .map { state in state.visibleHeight } - self.isHidden = self.visibleHeight.map({ $0 == 0.0 }).distinctUntilChanged() + self.isHidden = self.visibleHeight.map({ $0 <= .ulpOfOne }).distinctUntilChanged() super.init() // keyboard will change frame