Make KeyboardAvoider respect to safe area insets

This commit is contained in:
ismailgulek 2020-08-04 17:00:09 +03:00
parent eaedd478f1
commit 06d75eb6d1
No known key found for this signature in database
GPG key ID: E96336D42D9470A9

View file

@ -94,7 +94,7 @@ final class KeyboardAvoider: NSObject {
let keyboardFrameInView = view.convert(keyboardFrame, from: nil)
// Find how much the keyboard overlaps the scroll view
let scrollViewBottomInset = scrollView.frame.maxY - keyboardFrameInView.origin.y
let scrollViewBottomInset = max(scrollView.frame.maxY - keyboardFrameInView.origin.y - view.safeAreaInsets.bottom, 0)
UIView.animate(withDuration: animationDuration,
delay: 0.0,