Reputation: 47
I have a UITableView which is populated by the cells coming from another XIB file. How can I access the views (eg. label) of the cell inside didSelectRowAtIndexPath method of tableView?
Upvotes: 2
Views: 985
Reputation: 10479
Use cellForRowAtIndexPath
:
let cell = tableView.cellForRowAtIndexPath(indexPath) as! YourCustomCell
then you can access its label:
cell.customLabel.text = "test"
Upvotes: 3