~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:
@@ -81,10 +81,13 @@ class BrowserView: UIView
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func adjustOffsetForKeyboardNotification(userInfo: [AnyHashable : Any]) {
|
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 animationDuration = userInfo[UIWindow.keyboardAnimationDurationUserInfoKey] as? TimeInterval else { return }
|
||||||
guard let animationCurve = userInfo[UIWindow.keyboardAnimationCurveUserInfoKey] as? Int 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
|
let animationOptions: UIView.AnimationOptions = { curve -> UIView.AnimationOptions in
|
||||||
switch UIView.AnimationCurve(rawValue: curve) {
|
switch UIView.AnimationCurve(rawValue: curve) {
|
||||||
case .easeIn: return .curveEaseIn
|
case .easeIn: return .curveEaseIn
|
||||||
|
|||||||
Reference in New Issue
Block a user