From e9c758cfeefaf5b4e7db13399c126b84a499c915 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Mon, 15 Feb 2021 19:27:14 -0800 Subject: [PATCH] ~buzzert/rossler.attix#13: URL Bar overlaps keyboard in floating mode Just need to convert to screen coordinate space, as the documentation says... --- App/Browser View/BrowserView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/App/Browser View/BrowserView.swift b/App/Browser View/BrowserView.swift index 4cff180..b29a203 100644 --- a/App/Browser View/BrowserView.swift +++ b/App/Browser View/BrowserView.swift @@ -81,10 +81,13 @@ class BrowserView: UIView } private func adjustOffsetForKeyboardNotification(userInfo: [AnyHashable : Any]) { - guard let keyboardEndFrame = userInfo[UIWindow.keyboardFrameEndUserInfoKey] as? CGRect else { return } + guard var keyboardEndFrame = userInfo[UIWindow.keyboardFrameEndUserInfoKey] as? CGRect else { return } guard let animationDuration = userInfo[UIWindow.keyboardAnimationDurationUserInfoKey] as? TimeInterval else { return } guard let animationCurve = userInfo[UIWindow.keyboardAnimationCurveUserInfoKey] as? Int else { return } + // Convert keyboard frame to screen coordinate space + keyboardEndFrame = self.convert(keyboardEndFrame, from: UIScreen.main.coordinateSpace) + let animationOptions: UIView.AnimationOptions = { curve -> UIView.AnimationOptions in switch UIView.AnimationCurve(rawValue: curve) { case .easeIn: return .curveEaseIn