Search code examples
iosuicollectionviewuicollectionviewcellreloaddata

Update single UICollectionviewCell from VC


So I have a VC that allows ppl to send a friend request to any of the users listed in a collectionview and I want to switch from a add button to a loading indicator while the request is waiting on a response , but im not sure how to do this without calling [self.collectionview reloadData] , is there a way to temp change the appearance of a single cell w. out reloading the entire collectionview?


Solution

  • If you know the UICollectionViewCell pointer - call

    NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
    [self.collectionView reloadItemsAtIndexPaths:@[indexPath]];