Я хочу реализовать checkMark в ячейке tableView, но когда я выбираю ячейку, автоматически отображаются две checkMark в ячейке.
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0{
tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark
}
}
func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
if indexPath.section == 0{
tableView.cellForRow(at: indexPath)?.accessoryType = .none
//tableView.allowsMultipleSelection = false
}
}
это мой код