Collection-View-in-a-Table-View-Cell icon indicating copy to clipboard operation
Collection-View-in-a-Table-View-Cell copied to clipboard

Pagination with collection view vertical layout

Open Eman-Elsayed opened this issue 3 years ago • 1 comments

Thanks for your article.

I'm using API that return a paginated data , when data returned from page 2 ,the table view is refreshed and scrolled up to the top . I can't figure out how to update collectionView, without refresh table view . Thanks!

Eman-Elsayed avatar Oct 11 '21 08:10 Eman-Elsayed

Is page 2 data stored within a collection view? You might need to reload the individual table view row, or the collection view within that row. The latter option is probably better but also more work, since you'll need to store references to the collection views somewhere that you can access them later to reload. But also, you need to invalidate those references when they get recycled.

It's too complex a subject for me to give a detailed answer in a GitHub issue, but that's the high-level approach that I would take. Good luck 👍

ashfurrow avatar Oct 12 '21 13:10 ashfurrow