I have a label within my cells that I would like to show/hide when tapped. I know that I have to get the index path of the cell that was tapped from within didSelectRowAtIndexPath
. But I am unsure of how I then show/hide the label in that particular cell.
Am I able to show/hide it from within didSelectRowAtIndexPath
, or is there a way to deal with it in cellForRowAtIndexPath
and then update it?
I did some research into this but I really couldn't find a whole lot.
Here is all I have so far:
var selectedRowIndex: NSIndexPath = NSIndexPath(forRow: -1, inSection: 0)
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
selectedRowIndex = indexPath
}
didSelectRowIndexPath
.UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
and than hide label of this cell.