Reputation: 1
I have a tableview with multiple Sections. but i click on a tableviewCells row i should get that rows sections
Upvotes: 0
Views: 1364
Reputation: 89559
When the user clicks on a cell, a delegate method of "tableView:didSelectRowAtIndexPath:
" fires.
To get the row of the selected cell, you can get the indexPath parameter passed in. Assuming you name that parameter "indexPath
", getting the row would be as simple as "indexPath.row
". You can also get the section via "indexPath.section
".
Upvotes: 3