First of all thanks a lot for such useful library. I have a list interface which loads old items on scroll. My problem is after applying changes i am collectionView is loosing the current position after inserting new items above. To overcome i applied a technique i found in SO but it causes a flicker effect. Here what i used:
let contentHeight = collectionView!.contentSize.height
let offsetY = collectionView!.contentOffset.y
let bottomOffset = contentHeight - offsetY
let changes = diff(old: messages.old, new: messages.new)
collectionView!.reload(changes: changes, section: 0, completion: { _ in
self.collectionView!.contentOffset = CGPoint(x: 0, y: self.collectionView!.contentSize.height - bottomOffset)
})
Hi,
First of all thanks a lot for such useful library. I have a list interface which loads old items on scroll. My problem is after applying changes i am collectionView is loosing the current position after inserting new items above. To overcome i applied a technique i found in SO but it causes a flicker effect. Here what i used:
Any suggestions?
Best