How to reach the current selected cell in didSelectRowAtIndexPath?
Solution 1:
You can get the cell from didSelectRowAtIndexPath: method using the indexPath like this.
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
Solution 2:
In Swift 3.0 : You can use these 2 ways, according to your need
let cell:UITableViewCell = tableView.cellForRow(at: indexPath) as UITableViewCell
or
let cell:CustomTableViewCell = tableView.cellForRow(at: indexPath) as! CustomTableViewCell
Happy Coding !!
Solution 3:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
UITableViewCell *myCell = [tableView cellForRowAtIndexPath:indexPath];
// Access accessory View as below.
UIView * myCellAccessoryView = myCell.accessoryView;
}