In Swift:
cell.selectionStyle = UITableViewCell.SelectionStyle.none
or simply:
cell.selectionStyle = .none
In the Storyboard
or XIB
Attributes Inspector, set Selection
to None
.
Swift 3.0
cell.selectionStyle = .none
// Swift 2.0
cell.selectionStyle = UITableViewCellSelectionStyle.None
Objective-C:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// or
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
Swift 3+:
cell.selectionStyle = UITableViewCellSelectionStyle.none;
// or
cell.selectionStyle = .none
Swift 2:
cell.selectionStyle = UITableViewCellSelectionStyle.None
If you want to change it just using Interface Builder Storyboard/Xib, select the cell that you want to remove the "Selection Style Effect" and define it as "None". It'll work like magic as well :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With