Sample code
Post
Replies
Boosts
Views
Activity
Hi,
We’ve already checked our project using Time Profiler, and it turns out that every time items or sections are added to the collectionView, the layout for all sections is recalculated.
For testing purposes, I’ve attached some simple code. When pressing the addSection or addItem buttons, instead of generating the layout only for the newly added sections and items through the createLayout method, the layout for all visible sections is being recreated.
This is causing performance issues. Is there any way to resolve this?
Is it the intended behavior of UICollectionViewCompositionalLayout to recalculate the layout for all sections and items whenever items are added, instead of checking the diff through NSDiffableDataSourceSnapshot and only generating the layout for the newly added sections and items?
Thanks!