UITableViewCell selected row’s text color change

Do this in tableView:cellForRowAtIndexPath::

cell.textLabel.highlightedTextColor = [UIColor redColor];

(And don’t use cell.text = ... anymore. It has been deprecated for almost 2 years now. Use cell.textLabel.text = ... instead.)


As Raphael Oliveira mentioned in the comments, if the selectionStyle of your cell equals UITableViewCellSelectionStyleNone this won’t work. Check Storyboard as well for the selection style.

Leave a Comment

tech