user3001228
user3001228

Reputation: 343

Xcode reload just one cell in UiCollectionView

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?

Upvotes: 6

Views: 9367

Answers (2)

Michał Ciuba
Michał Ciuba

Reputation: 7944

Use the method called reloadItemsAtIndexPaths:

[self.collectionView reloadItemsAtIndexPaths:@[indexPathOfYourCell]];

Upvotes: 10

Bijender Singh Shekhawat
Bijender Singh Shekhawat

Reputation: 4474

For swift 4 use this code:-

self.collectionView.reloadItems(at: [indexPath!])

Upvotes: 2

Related Questions