didDeselectRowAtIndexPath indexPath es nulo
Tengo un TableViewController que implementa los métodos TableViewDelegate:
public override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let cell = tableView.cellForRowAtIndexPath(indexPath) as! ParticipantesSearchTableViewCell
cell.viewModel?.active = true
}
public override func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
let cell = tableView.cellForRowAtIndexPath(indexPath) as! ParticipantesSearchTableViewCell
cell.selectedStateImageView.hidden = true
cell.viewModel?.active = false
}
Tenga en cuenta que nunca elimino ni establezco mi tableView.editing en verdadero. También minumberOfRowsInSection
El método nunca cambia.
Si configuro mi tableView entableView.allowsSingleSelection = true
Puedo seleccionar y deseleccionar celdas muy bien y los métodos anteriores se disparan según lo previsto. Sin embargo, cuando me desplazo en mi tableView y selecciono una nueva celda, el método didDeselectRowAtIndexPath se bloquea enlet cell = tableView.cellForRowAtIndexPath(indexPath) as! ParticipantesSearchTableViewCell
En este punto depurétableView.indexPathForSelectedRow
y devuelve nulo
¿Alguna idea de lo que estoy implementando mal aquí o si esto es un error? Porque trato de usar la misma tabla contableView.allowsMultipleSelection = true
y puedo seleccionar, deseleccionar y desplazarme bien.