user2021238
user2021238

Reputation: 1

How to get the indexpath of uitableview section?

I have a tableview with multiple Sections. but i click on a tableviewCells row i should get that rows sections

Upvotes: 0

Views: 1364

Answers (1)

Michael Dautermann
Michael Dautermann

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

Related Questions