If you are a subclass of UITableViewCell, you can change its selected and selected user interface behavior by overriding the following methods.
- (void)setSelected:(BOOL)selected animated:(BOOL)animated; - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;
For instance:
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { [super setHighlighted:highlighted animated:animated]; if (highlighted) { self.backgroundColor = [UIColor redColor]; } else { self.backgroundColor = [UIColor blackColor]; } }
source share