Skip to main content
added 63 characters in body
Source Link
Rashid Latif
  • 2.9k
  • 26
  • 28

Swift 43,4 and 5

Better practice, write code in UITableViewCell

For example, you have UITableViewCell with the name MyCell, In awakeFromNib just write self.selectionStyle = .none

Full example:

class MyCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() self.selectionStyle = .none } } 

Swift 4 and 5

For example, you have UITableViewCell with name MyCell, In awakeFromNib just write self.selectionStyle = .none

Full example:

class MyCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() self.selectionStyle = .none } } 

Swift 3,4 and 5

Better practice, write code in UITableViewCell

For example, you have UITableViewCell with the name MyCell, In awakeFromNib just write self.selectionStyle = .none

Full example:

class MyCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() self.selectionStyle = .none } } 
Source Link
Rashid Latif
  • 2.9k
  • 26
  • 28

Swift 4 and 5

For example, you have UITableViewCell with name MyCell, In awakeFromNib just write self.selectionStyle = .none

Full example:

class MyCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() self.selectionStyle = .none } }