Remove the cell highlight color of UITableView

neha picture neha · May 7, 2010 · Viewed 85.8k times · Source

I want to remove the default blue color of uitableview cell selection. I don't want any selection color there. I have not created a custom cell class. I'm customizing the cell by adding labels and buttons over it. I tried doing:

cell.selectioncolor = [UIColor clearcolor];

but it says that this method is deprecated.

Answer

Vladimir picture Vladimir · May 7, 2010
cell.selectionStyle = UITableViewCellSelectionStyleNone;

in Swift 4 updated

cell.selectionStyle = UITableViewCell.SelectionStyle.none

Or

cell.selectionStyle = .none