I have a tableview with buttons and I want to use the indexpath.row when one of them is tapped. This is what I currently have, but it always is 0
var point =
Swift 4 Solution:
You have a button (myButton) or any other view in cell. Assign tag in cellForRowAt like this
cell.myButton.tag = indexPath.row
Now in you tapFunction or any other. Fetch it out like this and save it in a local variable.
currentCellNumber = (sender.view?.tag)!
After this you can use anywhere this currentCellNumber to get the indexPath.row of selected button.
Enjoy!