I'm using RxDataSources and trying to make a "toggle" function for cell selection — i.e., to allow cells (in a single-selection tableView) to be selected and deselected by tapping. I'm using
tableView.rx.itemSelected
to get the selection, and self?.tableView.deselectRow(at: indexPath, animated: false)
to deselect the cell, if it is currently in the selected state. This seems to basically work, but I want to respond to the deselection. I was assuming that self?.tableView.deselectRow(at: indexPath, animated: false)
would result in tableView.rx.itemDeselected
being called, but that never happens. I'm obviously missing something.
Any thoughts appreciated.