Skip to main content
added 246 characters in body
Source Link
Fattie
  • 9.8k
  • 76
  • 455
  • 769

Try to type:

cell.selected = NO; 

It will deselect your row when needed.

In Swift3 ...

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let r = indexPath.row print("clicked .. \(r)") tableView.cellForRow(at: indexPath)?.setSelected(false, animated: true) } 

Try to type:

cell.selected = NO; 

It will deselect your row when needed.

Try to type:

cell.selected = NO; 

It will deselect your row when needed.

In Swift3 ...

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let r = indexPath.row print("clicked .. \(r)") tableView.cellForRow(at: indexPath)?.setSelected(false, animated: true) } 
Source Link
Denis Kutlubaev
  • 16.3k
  • 6
  • 89
  • 72

Try to type:

cell.selected = NO; 

It will deselect your row when needed.