A
A
Aleksandr Govorukhin2017-03-02 14:02:46
iOS
Aleksandr Govorukhin, 2017-03-02 14:02:46

What does indexPathForSelectedRow look like in swift 3?

Hello! How to change indexPathForSelectedRow in swift 3 so that it doesn't throw an error. As I understand this function was removed or renamed, tell me how to fix it.
7b0e60937aac4d9bbfcea6b048475156.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iMike, 2017-03-05
@SnapSh0t

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question