LinkedInAttic / LayoutKit

LayoutKit is a fast view layout library for iOS, macOS, and tvOS.
http://layoutkit.org
Apache License 2.0
3.16k stars 267 forks source link

Possible solution for updating UICollectionViewCells with animation #163

Open spekke opened 7 years ago

spekke commented 7 years ago

Hi, The current solution for updating an UICollectionViewCell using reloadItems with BatchUpdates will dequeue a new cell from UICollectionView and apply the generated views from LayoutArrangement on that cell. This is okay if we are reloading the cell with completely new data. But in my case I just want to update the size of the content and the result is a bit jumpy. :/

I would like the possibility to compute the LayoutArrangements but give back the responsibility to the caller to update the views. In my case I would invalidate the cell context on the UICollectionViewLayout and apply a LayoutKit animation on the cell to update the content.

I know there are no tests included yet. I would like to discuss the solution before spending more time on it.

Thanks