-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
IGListCollectionViewLayout partial optimization issue in certain situation #1275
Comments
@xohozu is there a way to repro this in an example project so we can take a look? Also you should be able to get around this by invalidating the layout on the collection context: https://github.com/Instagram/IGListKit/blob/master/Source/IGListCollectionContext.h#L236-L247 |
I uploaded a reproducible example project by reusing existing ModelingAndBinding demo.
// in `PostSectionController.swift` line48
case let viewModel as ActionViewModel: height = CGFloat(55 + 2 * (viewModel.likes / 10))
Some observed results as follow:
// in `IGListCollectionViewLayout.mm` line447
- (void)_calculateLayoutIfNeeded {
if (_minimumInvalidatedSection == NSNotFound) {
return;
}
...
} always return in advance due to optimization of
I have a straightforward solution(#1285) to fix this issue probably that those updating(not inserts or deletes) cells need to invalidate their attributes before re-binding new view model in |
New issue checklist
README
and documentationGeneral information
IGListKit
version: 3.4.0Debug information
# Please include debug logs using the following lldb command: po [IGListDebugger dump]
Description
If we use IGListBindingSectionController, and want to update first item of the section that both UI elements and cell size will be changed. Since IGListBindingSectionController can just
reload
cell not insert+delete, the updating cell will be invokedbindViewModel:
again so that we can update its UI elements. However, we have no way to update the size of cell if using IGListCollectionViewLayout because ofminimumInvalidatedSection
not affected. And theperformBatchUpdates:
is not triggered byupdateAnimated:
in IGListBindingSectionController butperformUpdatesAnimated:
in IGListAdapter.Below are related code snippets.
in IGListBindingSectionController.m
in IGListCollectionViewLayout.mm
The text was updated successfully, but these errors were encountered: