iosuitableviewcustom-cell

UITableViewCell. How do I just highlight cell during touch down?


I have a custom tableViewCell. I want to indicate user touch down by highlighting. The cell selection style is UITableViewCellSelectionStyleBlue. In the parent controller I have set self.clearsSelectionOnViewWillAppear = YES.

I should be good to go. Nope. Selection still sticks to the cell. What I want is selection indication only for the duration of the touch down. The appearance should immediately return to the unselected appearance on touch up.

How do I do this?

Cheers,
Doug


Solution

  • - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    }