title: Performing a segue after choosing a UITableViewCell
body: <p>I have used segue, which should pass the index of cell that was pressed in my <strong>TableView</strong>, but the problem is that function <strong><code>didSelectRowAt</code></strong> runs after my segue. That sague was made by control dragging from a <strong>custom cell</strong> to another <strong>view</strong>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>override  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  
      selectedScheduleN = indexPath.row
      self.performSegue(withIdentifier: "edit", sender: nil)
  }
  
  
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      switch(segue.identifier ?? "") {
      case "edit" :
          print ("normal function")
          var dest : editScheduleViewController = segue.destination as! editScheduleViewController
          dest.x = selectedScheduleN
      case "add" : return
  
      default : return
  
  
      }
  }
  </code></pre>
  
  <p>Thanks in advance!</p>