Perhaps you could implement the table view delegate methods:
tableView(_:shouldHighlightRowAtIndexPath:)
and
tableView(_:didSelectRowAtIndexPath:)
... and determine (from indexPath.row and indexPath.section ) if the corresponding section supports single / multiple selection (this will depend on the user logic of the -eg data model: "Section 0 supports multiple selection, but section 1 is not") , and if it supports only one selection, check if there is already a selected row (by accessing tableView.indexPathsForSelectedRows ).
If there is already a selected row, you can:
- Return
false from tableView(_:shouldHighlightRowAtIndexPath:) and - Don't do anything (just
return ) from tableView(_:didSelectRowAtIndexPath:) (I'm not sure if this method is actually called when you return false from shouldHighlight... , so maybe check it out).
source share