UICollectionView update a single cell

Paulius Dragunas picture Paulius Dragunas · Nov 30, 2013 · Viewed 63.9k times · Source

I am attempting to update a single cell inside a UICollectionView, specifically I am just trying to update an image in that specific cell detonated by cell.imageView. [self.collectionView reloadData] is not really an option because it makes the whole collection view flash. [self.collectionView beginUpdates] is not a thing in a UICollectionViewit seems.

I understand I may be able to use:

[self.collectionView performBatchUpdates:^{
    //do something
} completion:nil];

I am not exactly sure what to put inside a completion block to update that certain cell's imageView. This is all being done inside of didSelectItemAtIndexPath.Also I am not using NSFetchedResultsController. Any ideas?

Answer

Dinesh Raja picture Dinesh Raja · Nov 30, 2013

- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths

Here it is a method to reload the specific indexPaths in your collectionView