Я хочу установить текст метки в ячейке прототипа в строке, которая хранится в массиве.
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "unitOptionCell", for: indexPath)
cell.textLabel?.text = currentConvertion.availableUnits(indexPath)
return cell
}
Массив следующий:
var availableUnits: [String] {
switch category {
case .firstCategory:
return ["test 1", "test 2", "test 3"]
case .secondCategory:
return ["test 4", "test 5", "test 6"]
case .thirdCategory:
return ["test 7", "test 8", "test 9"]
}
}
где ошибка?