Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit eafcbd7

Browse files
committed
Reload items along with other updates in batch update block
1 parent e4f2897 commit eafcbd7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Pod/Classes/WPMediaPickerViewController.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ - (void)updateDataWithRemoved:(NSIndexSet *)removed inserted:(NSIndexSet *)inser
688688
if ([inserted count] > 0) {
689689
[self.collectionView insertItemsAtIndexPaths:[self indexPathsFromIndexSet:inserted section:0]];
690690
}
691+
if ([changed count] > 0) {
692+
[self.collectionView reloadItemsAtIndexPaths:[self indexPathsFromIndexSet:changed section:0]];
693+
}
691694
for (id<WPMediaMove> move in moves) {
692695
[self.collectionView moveItemAtIndexPath:[NSIndexPath indexPathForItem:[move from] inSection:0]
693696
toIndexPath:[NSIndexPath indexPathForItem:[move to] inSection:0]];
@@ -697,9 +700,7 @@ - (void)updateDataWithRemoved:(NSIndexSet *)removed inserted:(NSIndexSet *)inser
697700
}
698701
} completion:^(BOOL finished) {
699702
[weakSelf refreshSelection];
700-
NSMutableSet<NSIndexPath *> *indexPaths = [NSMutableSet setWithArray:[weakSelf indexPathsFromIndexSet:changed section:0]];
701-
[indexPaths addObjectsFromArray:weakSelf.collectionView.indexPathsForSelectedItems];
702-
[weakSelf.collectionView reloadItemsAtIndexPaths:[indexPaths allObjects]];
703+
[weakSelf.collectionView reloadItemsAtIndexPaths:weakSelf.collectionView.indexPathsForSelectedItems];
703704
}];
704705

705706
}

0 commit comments

Comments
 (0)