Answer the question
In order to leave comments, you need to log in
How to make different value in uitableview cell?
Hello. I have a table, when I click on a cell, it moves to the next table. But when I set the value for the cells of the second table, all all cells have the same text. For example, if I clicked on the first cell of the first table, a table should open with the values: 1, 2, 3; if I click on the second cell of the first table, a table should open with the values: 4, 5, 6, etc. Thanks to all.
Answer the question
In order to leave comments, you need to log in
Most likely you need to handle the didSelectRowAt method of the UITableViewDelegate protocol .
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.row {
case 0:
// Сделать что-то по нажатию на ячейку с индексом 0
break
case 1:
// Сделать что-то по нажатию на ячейку с индексом 1
break
default:
break
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question