UITableViewCell checkmark to be toggled on and off when tapped
Swift > 3.0 func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { if let cell = tableView.cellForRow(at: indexPath) { cell.accessoryType = .none } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if let cell = tableView.cellForRow(at: indexPath) { cell.accessoryType = .checkmark } } I solved by using two Swift functions: the didSelectRowAtIndexPath and the didDeselectRowAtIndexPath. … Read more