Make KeyboardAvoider respect to safe area insets

This commit is contained in:
ismailgulek
2020-08-04 17:00:09 +03:00
parent a9044c7955
commit 716ae3e2fe
@@ -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,