6

I want to reload just one cell in a UICollectionView.

I know in UITableView it is something like this :

[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPathOfYourCell, nil] withRowAnimation:UITableViewRowAnimationNone];

but what about UICollectionView?

Michał Ciuba
  • 7,876
  • 2
  • 33
  • 59
user3001228
  • 343
  • 3
  • 13
  • possible duplicate of [UICollectionView update a single cell](http://stackoverflow.com/questions/20296929/uicollectionview-update-a-single-cell) – n00bProgrammer Mar 01 '15 at 12:14

2 Answers2

10

Use the method called reloadItemsAtIndexPaths:

[self.collectionView reloadItemsAtIndexPaths:@[indexPathOfYourCell]];
Michał Ciuba
  • 7,876
  • 2
  • 33
  • 59
2

For swift 4 use this code:-

self.collectionView.reloadItems(at: [indexPath!])
Bijender Singh Shekhawat
  • 3,934
  • 2
  • 30
  • 36