Environment: iOS 15.7.5 Device: iPhone 7
Problem:
When collectionview cell textview is in edit mode and keyboard is shown - it bounces up the textview position causing overlaps. Video attached.
The issue only occurs on iOS 15 version. It works well in iOS 16, 17 version.
The issue occurs when Selected keyboard language is other than English.
In ViewController i am updating collectionViewBottomConstraint when keyboard is up or down to enable scroll to the end of collectionview when keyboard is shown.
disposable += NotificationCenter.default.reactive
.notifications(forName: UIResponder.keyboardWillShowNotification)
.take(duringLifetimeOf: self)
.observeValues { [weak self] notification in
guard let self else { return }
let keyboardInfo = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey]
guard var height = (keyboardInfo as? NSValue)?.cgRectValue.height else {
OALogInfo("[SetLocationInfo][VC] height is nil")
return
}
height -= self.view.safeAreaInsets.bottom
self.collectionViewBottomConstraint.constant = -height
self.collectionViewBottomConstraint.isActive = true
}
disposable += NotificationCenter.default.reactive
.notifications(forName: UIResponder.keyboardWillHideNotification)
.take(duringLifetimeOf: self)
.observeValues { [weak self] notification in
guard let self else { return }
self.collectionViewBottomConstraint.constant = 0
self.collectionViewBottomConstraint.isActive = true
}