~buzzert/rossler.attix#13: URL Bar overlaps keyboard in floating mode

Just need to convert to screen coordinate space, as the documentation says...
This commit is contained in:
James Magahern
2021-02-15 19:27:14 -08:00
parent 41289bf790
commit e9c758cfee

View File

@@ -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