I have a UITableViewCell that is selected when tapped. During this selected state, if the user taps the cell again, I want the cell to deselect.
UITableViewCell
I can\
Swift 5.
In the UITableViewDelegate, it's as simple as follows:
UITableViewDelegate
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) }