-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layoutAttributesForSupplementaryItemInSection called too often #100
Comments
Ah yes, I perform a linear search and get the layout attributes for each supplementary item to see if it intersects the visible rect. This should probably be deferred to the layout as well, as it does for the cells already. |
Also I've just figured out that: |
NSOrderedSet
can replace linear search by binary |
@allright I can't assume the layout is going to be linear (in which case a binary search would be fine), so I have to fallback to a linear search. That's why I suggested it be deferred to the layout class, as it's already done in for the cells. I use a binary search already for the cells in the list view. Do the lag issues go away when you switch off sticky headers? I didn't test the sticky header code with a large number of sections, and that code would be badly optimized in that case. If you have any better ideas for implementation I'm all ears. |
I have to dig into the code a little deeper to generate idea... |
Closing this issue in favor of #108. |
Have to optimize
JNWCollectionViewFramework:layoutIdentifiersForSupplementaryViewsInRect:(CGRect)rect{
}
to call layoutAttributesForSupplementaryItemInSection only for visible sections
Test case: a table with 1000 sections - may be not smooth.
I will try to fix...
The text was updated successfully, but these errors were encountered: