Search code examples
iosuitableviewios6uiimagecheckmark

How to perform show and hide effect for image on UITableViewCell?


In my iPhone app I have to show check-mark image on left side of the cell, first time there is no image on the cell, when user select the cell it will show the check mark image on right side of the cell, if user again select the same cell image should be hide.


Solution

  •  if (cell.checkMarkImage.image == [UIImage imageNamed:@"checkMarkiPad.png"])
    {
        cell.checkMarkImage.image=[UIImage imageNamed:@""];
    }
    else{
        cell.checkMarkImage.image = [UIImage imageNamed:@"checkMarkiPad.png"];
    }