iOS: reload single cell of UICollectionView

后端 未结 5 1499
無奈伤痛
無奈伤痛 2021-01-11 19:21

I am trying to follow the following post on reload a cell in a UICollectionView:

UICollectionView update a single cell

I know that I ultimately want somethin

5条回答
  •  一生所求
    2021-01-11 19:57

    - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
    {
        NSDictionary *dic = @{@"option":[NSNumber numberWithBool:YES]};
        [self.array insertObject:dic atIndex:indexPath.row];
    
        [collectionView reloadItemsAtIndexPaths:@[indexPath]];
    }
    

提交回复
热议问题