Okay I get the same error unrecognized selector sent to instance '0x7fd4c4098200'. I tried both ways but end up with the same error. You don't but the button in the cell?
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "hs" {
if let destinationController = segue.destination as? HighlightsVC, let destName = selectedNameInCell {
destinationController.playerName = destName
}
}
}
override func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
if let cell = tableView.cellForRow(at: indexPath) as? FavCell {
selectedNameInCell = cell.name.text
}
return indexPath
}
@IBAction func CamButtonA(_ sender: UIButton) {
performSegue(withIdentifier: "hs", sender: nil)
}