Hello! How to change indexPathForSelectedRow in swift 3 so that it does not give an error. As I understand this function was removed or renamed, tell me how to fix it.

code

override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showDetails" { if let destination = segue.destination as? CalculateViewController { let indexPath = TheChoiseOfShipTableViewController.indexPathForeSelectedRow destination.ships = self.ships[indexPath.row] } } } } 

Error: Type "TheChoiseOfShipTableViewController" has no member "indexPathForeSelectedRow"

  • For a start, code the code as a code, not a screenshot. Also add text errors. - VAndrJ
  • did, I can lay out the whole project - Alexander Govorukhin

1 answer 1

If you only look at the screen, indexPathForSelectedRow you are trying to call from the controller class, not the tableView object.

Well, the index with a small letter, not IndexPath.row , but indexPath.row .

  • from tableView same error - Alexander Govorukhin