0

Scrolling a collection view with a large number of supplementary header views is extremely slow. The more sections, the worst is the scrolling performance. (Tested with 5,000 sections).

Best to give it a try and see for yourself.

Code is available at https://github.com/yoasha/CollectionViewTest

To reproduce, run the demo app with Xcode on either iPhone or iPad simulator (or a real device), select "Collection View" on the main page, and try to scroll.

Any thoughts?

10
  • Please don't post duplicate questions (stackoverflow.com/questions/71604132/…) ... That sample code may not be the best approach for your needs. As a side note, having 5,000 sections in a collection view (or table view) is impractical -- no user is going to scroll that far. You probably want to rethink your UI/UX Commented Mar 28, 2022 at 19:24
  • 1) I accept your comment and apologize about the duplicate post. It's a second and last try getting help from the community as I hoped that a much shorter and more precise post will attract more attention. Sorry about that. Commented Mar 28, 2022 at 20:37
  • 2) Regarding the 5,000 sections I agree it sounds a lot, but this is only a test. I have real world cases with 2,000 sections which also present serious scrolling issues. Commented Mar 28, 2022 at 20:39
  • 3) Regarding UI/UX I must disagree, as the index titles feature completely targets that. My users love to see their entire library (even though they have plenty of filters in the UI) and they use the title index frequently to jump from one area to another, so they don't actually need to scroll through all the sections. Commented Mar 28, 2022 at 20:39
  • 4) Lastly, even though it's not mentioned in my post, UITableView has no scrolling issue with 5,000 section. I actually tested with 10,000 sections, and scrolling is smooth. So technically speaking, why should collection and table views behave so differently in this aspect? Shouldn't I expect collection view to be as efficient and fast scrolling as table view? Commented Mar 28, 2022 at 20:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.