Valentin Scheldeman
Valentin Scheldeman

Reputation: 51

Retrieve customCell label text value

I have a tableView with custom Cell and text in a label for each cell

When i'm selecting a cell i'm highlighting this cell with another color and saving it in a variable so that when i'm using my "next" button, i'm going to another view with the last selected cell value

My problem is that the variable is retrieving the name of the label and not the text i assigned to it ..

enter image description here

Upvotes: 1

Views: 40

Answers (1)

Sherman
Sherman

Reputation: 171

You can just do it like this in your func tableView(UITableView, didSelectRowAt: IndexPath).

selectedCellText = careerSource[indexPath.row]

Upvotes: 2

Related Questions