I have UICollectionView with cells inside. Everything works well except one thing.
During keyboard appearance animation, top cells that are about to go offscreen just disappear in place without any animation
https://drive.google.com/file/d/17GROrgdqNDMZJf-ym-0FjT6NgFQHjelc/view?usp=sharing
I have tried to implement
finalLayoutAttributesForDisappearingItem but it has no any effect. Also tried to expand rect in layoutAttributesForElementsInRectoverride func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
let rect = CGRect(x: rect.minX, y: rect.midY - 312, width: rect.width, height: rect.height + 312)
return itemAttributesCache.filter { $0.frame.intersects(rect) }
}but also with no luck.
The only working solution that i found is to expand
UICollectionView.frame above the screen to the keyboard height and set UICollectionView.contentInset.top to the keyboard height. It works but absolutely ugly.Any ideas how to fix it?