I want to perform scroll to particular index path after collection view load complete. Is there any method that inform the collection view is loaded (set layout, set datasource)
NOTE: Im using DiffableDatasource to display collection view. I tried .apply snapshot completion – not working for me.
3
Answers
Scroll to desired indexPath on completion of snapshot apply action working for me. Here is the code:
Thanks.
Please check where are you calling you collectionView.reloadData() lastly. after that line, you can simply call this.
For reference, visit this link.
How to scroll to a particluar index in collection view in swift
In swift collectionView comes with scrollView property and that you can use to scroll to the particular item’s index
for more information please go through this documentation