0
let indexPaths = (0..<array.count - 1).map { i in
return IndexPath(item: i, section: section)
}
tableView.beginUpdates()
if hidden[section] {
array.remove(at: IndexPath(item: item, section: section).row)
tableView.deleteRows(at: indexPaths, with: .fade)
} else {
tableView.insertRows(at: indexPaths, with: .fade)
}
tableView.endUpdates()
해당 섹션의 헤더가 탭될 때 UITableView에서 섹션의 모든 셀을 삭제하려고합니다. 그러나 올바르게 작동하지 않는 것 같습니다.Swift에서 UITableView의 행을 삭제하는 방법
오류가 "Cannot convert value of type CountableRange<Int> to expected argument Int".
모든 셀을 삭제하는 올바른 방법은 무엇입니까 있다고?
데이터 소스 배열의 모든 항목 ('removeAll()')을 삭제하고 적절한 섹션을 통과하는 tableView에서'deleteSections()'를 호출하십시오. – vadian