I am trying to achieve to make my TableView only accept one checkbox per cell.
I have used this solution to save User Defaults for the checkmarks which works fine but it allow multiple selections.
I have tried so many solutions on Stack overflow but since this is formatted a little different I was unable to use those solutions.
Things I have tried which did not work:
Tried setting the accessory type to none at the didDeselectRowAt
func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
tableView.cellForRow(at: indexPath)?.accessoryType = .none
}
Tried setting the table view to not allow multiple selections on the viewDidNotLoad
override func viewDidLoad()
{
tableViewName.allowsMultipleSelection = false
}
Based the solution I linked, how would I go to only allow a single selection?