I added a button @IBOutlet weak var cellButton: UIButton!
in my custom tableViewCell
class and an action of the button in my tableView
controller
@IBAction func cellButtonTap(_ sender: UIButton) {
performSegue(withIdentifier: "goToMap" , sender: self)
}
what I need to do is to pass data to another viewController but is important to know on which cell the button has been pressed, so how can I tell my method prepare
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "goToMap"...//HERE I DON'T KNOW HOW TO DO
}
on which cell the button has been pressed? I'm a beginner and I've been looking for a solution for two days but I have not found it yet