0

I have a tableview with a custom cell that include a button, this button should delete the entry (and reload the tableview) after it been hit.

So i m looking for a way to get the index path of the cell from the botton?

Fabian Boulegue
  • 6,476
  • 14
  • 47
  • 72

1 Answers1

2

In your cellForRowAtIndexPath: method you can define a tag for your UIButton.

Something like

cell.button.tag = indexPath.row

Then when the buttons action is triggered you can get the indexPath via button.tag.

dehlen
  • 7,325
  • 4
  • 43
  • 71