Skip to content

Commit

Permalink
Fix the displayDelegate bug from IGListSectionController
Browse files Browse the repository at this point in the history
Summary:
We were using the iVar version of the `_displayDelegate`, but turned out a lot of product callsite just manually override the `displayDelegate` instead of use `self.displayDelegate = self`.

Let's use the self.displayDelegate instead.

Reviewed By: bdotdub

Differential Revision: D20037298

fbshipit-source-id: fa860adfa88cd088f39718279983acd32e90b478
  • Loading branch information
lorixx authored and facebook-github-bot committed Feb 21, 2020
1 parent 6dfdce1 commit 191063e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/IGListKit/IGListSectionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ - (void)moveObjectFromIndex:(NSInteger)sourceIndex toIndex:(NSInteger)destinatio
}

- (void)willDisplayCell:(UICollectionViewCell *)cell atIndex:(NSInteger)index listAdapter:(IGListAdapter *)listAdapter {
[_displayDelegate listAdapter:listAdapter willDisplaySectionController:self cell:cell atIndex:index];
[self.displayDelegate listAdapter:listAdapter willDisplaySectionController:self cell:cell atIndex:index];
}

- (void)didEndDisplayingCell:(UICollectionViewCell *)cell atIndex:(NSInteger)index listAdapter:(IGListAdapter *)listAdapter {
[_displayDelegate listAdapter:listAdapter didEndDisplayingSectionController:self cell:cell atIndex:index];
[self.displayDelegate listAdapter:listAdapter didEndDisplayingSectionController:self cell:cell atIndex:index];
}

- (void)willDisplaySectionControllerWithListAdapter:(IGListAdapter *)listAdapter {
[_displayDelegate listAdapter:listAdapter willDisplaySectionController:self];
[self.displayDelegate listAdapter:listAdapter willDisplaySectionController:self];
}

- (void)didEndDisplayingSectionControllerWithListAdapter:(IGListAdapter *)listAdapter {
[_displayDelegate listAdapter:listAdapter didEndDisplayingSectionController:self];
[self.displayDelegate listAdapter:listAdapter didEndDisplayingSectionController:self];
}

@end

0 comments on commit 191063e

Please sign in to comment.