Answer the question
In order to leave comments, you need to log in
How to pass cell index for each of two buttons?
How can I pass their cell index for the "Edit" and "Delete" buttons
Answer the question
In order to leave comments, you need to log in
Where are you processing the click? Inside the cell itself?
UPD
You can get out like this:
BUT this is the wrong approach, Read about MVC. You don't need to do this inside a cell.super.tableView.indexPath(for: self)
@IBAction func change(sender: UIButton) {
for case let mycell as MyCustomCell in tableView.visibleCells where mycell.changeButton === sender {
let indexPath = tableView.indexPath(for: myCell)
// ...
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question