How can I set the UITableView\'s cell property to be unselectable? I don\'t want to see that blue selection box when the user taps on the cell.
use this:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
using IB is also an elegant way:
Swift 4:
In the cell class:
selectionStyle = .none
There is another simple way to avoid the selection appearing as blue.
Select a cell you don't want to appear as blue.
Then select the attributes inspector (the shield icon next to the ruler icon on the properties view on the side).
Then change the 'Selection' field from 'Blue' to 'None'.
Note, presumably this is still selecting, it will just not appear as selected if all you want is to avoid the UI effect.
Swift 5
cell.isUserInteractionEnabled = false
For iOS 6+ only.
You can implement the method
tableView:shouldHighlightRowAtIndexPath:
in your delegate.
Read more here : http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html