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 =
Very Simple getting Index Path swift 4, 5
let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! Cell
cell.btn.tag = indexPath.row
cell.btn.addTarget(self, action: "buttonTapped:", forControlEvents:
UIControlEvents.TouchUpInside)
How to get IndexPath Inside Btn Click :
func buttonTapped(_ sender: UIButton) {
print(sender.tag)
}