Chromium Code Reviews| Index: ios/chrome/browser/ui/collection_view/collection_view_controller.mm |
| diff --git a/ios/chrome/browser/ui/collection_view/collection_view_controller.mm b/ios/chrome/browser/ui/collection_view/collection_view_controller.mm |
| index 3914205819c4c2e2e8292078ee5f2d8bd9978e74..c7338e3e8fd0d404e0e7683b6bc8fae35e076200 100644 |
| --- a/ios/chrome/browser/ui/collection_view/collection_view_controller.mm |
| +++ b/ios/chrome/browser/ui/collection_view/collection_view_controller.mm |
| @@ -74,14 +74,15 @@ |
| NSIndexPath* indexPath = |
| [self.collectionViewModel indexPathForItem:item |
| inSectionWithIdentifier:sectionIdentifier]; |
| - MDCCollectionViewCell* cell = |
| - base::mac::ObjCCastStrict<MDCCollectionViewCell>( |
| - [self.collectionView cellForItemAtIndexPath:indexPath]); |
| + [self reconfigureCellsAtIndexPath:indexPath withItem:item]; |
| + } |
| +} |
| - // |cell| may be nil if the row is not currently on screen. |
| - if (cell) { |
| - [item configureCell:cell]; |
| - } |
| +- (void)reconfigureCellsAtIndexPaths:(NSArray*)indexPaths { |
| + for (NSIndexPath* indexPath in indexPaths) { |
| + CollectionViewItem* item = |
| + [self.collectionViewModel itemAtIndexPath:indexPath]; |
| + [self reconfigureCellsAtIndexPath:indexPath withItem:item]; |
| } |
| } |
| @@ -268,4 +269,19 @@ |
| } |
| } |
| +#pragma mark - Private |
| + |
| +// Reconfigure the cell at |indexPath| by calling |configureCell:| with |item|. |
|
lpromero
2017/03/08 17:30:19
Reconfigures
gambard
2017/03/09 09:02:04
Done.
|
| +- (void)reconfigureCellsAtIndexPath:(NSIndexPath*)indexPath |
|
lpromero
2017/03/08 17:30:19
cell
gambard
2017/03/09 09:02:03
Done.
|
| + withItem:(CollectionViewItem*)item { |
| + MDCCollectionViewCell* cell = |
| + base::mac::ObjCCastStrict<MDCCollectionViewCell>( |
| + [self.collectionView cellForItemAtIndexPath:indexPath]); |
| + |
| + // |cell| may be nil if the row is not currently on screen. |
| + if (cell) { |
| + [item configureCell:cell]; |
| + } |
| +} |
| + |
| @end |