A Tour of UICollectionView
A Tour of UICollectionView
WWDC 2018
Flow Layout

Customize the layout


We can make it better!


When To Go Custom?


It works!
But the scrolling performance is bad.

We can make it better

PerformBatchUpdate()
- Animate updates together
- Perform data source updates and collection view updates in updates closure
- Collection view updates ordering does not matter!!!
- Data Source updates ordering does matter!!!

DataSource Updates: Order Matters

Collection View Updates Coalescing

Update Combinations That Don’t Make Sense😡
- Move and Delete the same location 😡
- Move and Insert to the same location 😡
- Move more than 1 location to the same location 😡
- Referencing an invalid IndexPath 😡

We can fix it!


