
I have two designs for the UITableViewCells, one for the selected cells and other for the unselected cells. I can detect that a cell was selected and deselected in these events to modify their design:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
But when the user tap & hold a Cell, the cell is highlighted but none of these events are activated, so I cant repaint the shadows of the UITextLabels correctly because the UITitleLabels have the method: titleLabel.highlightedTextColor but not the method titleLabel.highlightedShadowColor.
In the image:
1 - Unselected cell
2 - Selected cell
3 - Tap & hold cell, with ugly shadows.
How can I detect the user tap & hold a cell?
You could use a
UILongPressGestureRecognizerlike this:add the gesture to the cell in your
cellForRowAtIndexPath:handle the selector
(Not tested).