collection cell button click change the cell image


-(void)buttonAct:(UIButton *)sender {
    NSLog(@"%ld",(long)sender.tag);

    UICollectionViewCell *cell = (UICollectionViewCell*)[[sender superview] superview];
    NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
    
    if (indexPath.row == sender.tag) {
        //assert(false);
        cell.image_View.image=[UIImage imageNamed:@"1.png"];

        return;
    }
    

}

Previous
Next Post »