How to change a cell’s selection colour

By default, when you touch a cell in a UITableView, it lights up bright blue. You can use this property to change the cell’s selection style in the cellForRowAtIndexPath method:

cell.selectionStyle = UITableViewCellSelectionStyleGray;

Possible values are

  • UITableViewCellSelectionStyleGray
  • UITableViewCellSelectionStyleBlue (the default)
  • UITableViewCellSelectionStyleNone

Alternatively you can select the cell in Interface Builder and pick these values from the drop down menu:

Screen Shot 2013-01-11 at 01.05.19





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.