Я устанавливаю UITableView
с несколькими разделами, а в разделе один есть один выбор, а в разделе два - несколько вариантов выбора. Он хочет именно то, что происходит в UberEats
при выборе дополнений и типа пищи
Я сделал расширение и закрытие строк ячеек и хочу обновить метки в настраиваемом заголовке
var selectedIndexPath: IndexPath?
В cellForRowAt
if let inxPath = selectedIndexPath{
if inxPath.section == 0{
if inxPath == indexPath{
if inxPath.row == indexPath.row && inxPath.section == indexPath.section{
cell.radioButtonImageView.image = #imageLiteral(resourceName: "radioCheck")
}
}
}
if inxPath.section == 1{
if inxPath.row == indexPath.row && inxPath.section == indexPath.section{
if cell.radioButtonImageView.image == #imageLiteral(resourceName: "IconUnmarked"){
cell.radioButtonImageView.image = #imageLiteral(resourceName: "IconMarked")
}else if cell.radioButtonImageView.image == #imageLiteral(resourceName: "IconMarked"){
cell.radioButtonImageView.image = #imageLiteral(resourceName: "IconUnmarked")
}
}
}
}
В didSelectRowAt
selectedIndexPath = indexPath
tableView.reloadData()