title: Get indexPath for segue
body: <p>I'm trying to get indexPath for existing cell for certain segue actions.</p>
  
  <pre><code> override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
         if segue.identifier == "EditItem" {
         let controller = segue.destination as! TimerSelectViewController
         controller.delegate = self
         if let indexPath = tableView.indexPath(for: sender as! UITableViewCell) {
         controller.itemToEdit = timers[indexPath.row]
             }
         }
      }
  </code></pre>
  
  <p>I call segue in didSelectRowAt:</p>
  
  <pre><code>override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
      tableView.deselectRow(at: indexPath, animated: true)
      performSegue(withIdentifier: "EditItem", sender: nil)
  
  }
  </code></pre>
  
  <p>But everytime I click on cell I get nil and my app crash. I don't understand why </p>
  
  <pre><code>if let indexPath = tableView.indexPath(for: sender as! UITableViewCell) 
  </code></pre>
  
  <p>returns each time nil.</p>