Использовать tableView(_:cellForRowAt:)
метод из UITableViewDataSource
, вот так
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "CellId", for: indexPath)
if indexPath.section == DISABLED_SECTION_INDEX {
cell.isUserInteractionEnabled = false
} else {
cell.isUserInteractionEnabled = true
}
}
Или без оператора if
cell.isUserInteractionEnabled = indexPath.section != DISABLED_SECTION_INDEX