mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-23 09:18:29 +00:00
Fix a bug in IGListBindingSingleSectionController for displayingCell setting
Summary: When a section/cell is reloaded, UICollectionView actually calls: 1/ WillDisplay (new cell) 2/ DidEndDisplay (old cell) So if we set `_displayingCell` in willDisplay call, then set it to nil in didEndDisplay, we would just have a nil cell. Thus we need to make sure the cell in `didEndDisplay` match with the previous `_displayCell` to avoid nil-ing ourselves out. Reviewed By: alanzeino Differential Revision: D19906734 fbshipit-source-id: 5217908ae99d488a2af5ff3f90ef8e021774acda
This commit is contained in:
parent
fecf9e4124
commit
bb89f70510
1 changed files with 3 additions and 1 deletions
|
|
@ -72,7 +72,9 @@
|
|||
|
||||
- (void)listAdapter:(nonnull IGListAdapter *)listAdapter didEndDisplayingSectionController:(nonnull IGListSectionController *)sectionController cell:(nonnull UICollectionViewCell *)cell atIndex:(NSInteger)index {
|
||||
IGParameterAssert(index == 0);
|
||||
_displayingCell = nil;
|
||||
if (cell == _displayingCell) {
|
||||
_displayingCell = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - IGListSectionController Overrides
|
||||
|
|
|
|||
Loading…
Reference in a new issue