Illep
Illep

Reputation: 16851

Get cell title from table view

I have a custom table view and each cell has a title and a button. When the user clicks on the button, I need the title of that cell to appear on another view. How do I get this?

Upvotes: 0

Views: 477

Answers (1)

UPT
UPT

Reputation: 1480

It's not very tough here are the 2 solutions:

When you are creating the cell, assign tag to the label you want to get the title value (or text value)

second option is:

If you want to get the title at the didselect select method just get the cell from the table view with the help of indexpPath.row and then extract the label and it's text. You can assign the tag in the custom cell design and then extract it from cell (once you get the cell).

Upvotes: 1

Related Questions