title: Prepare for segue returning nil for indexPathForSelectedRow?
body: <p>I want to pass information from an array from one viewController to another based on what row was selected in my <code>tableView</code>.  To do this I have implemented the following functions:</p>
  
  <pre><code>func tableView(_ messagesListTableView: UITableView, didSelectRowAt indexPath: IndexPath) {
          messagesListTableView.deselectRow(at: indexPath, animated: true)
          performSegue(withIdentifier: "individualMessageSegue", sender: self)
          print(indexPath)//returns [0,0]... meaning the first row
      }
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          guard segue.identifier == "individualMessageSegue" else{return}
  
          if let indexPath = self.messagesListTableView.indexPathForSelectedRow{
              let openedMessageConversation = fullOrderedMessageArray[(indexPath.row)] //cause app to crash because nil value
              let destViewController: IndividualMessageVC = segue.destination as! IndividualMessageVC
              destViewController.messageConvo = openedMessageConversation
          }else{
              print("it was nil")
          }
  
      }
  </code></pre>
  
  <p>I believe I have everything set up correctly, however despite the print statement from the <code>didSelectRowAt</code> always returning a value for the <code>indexPath</code> of [0,0] (in the table there is only one section and one row), the print statement in <code>prepare</code> always tells me that the <code>indexPath</code> is <code>nil</code>. If I remove the <code>if let</code> conditional, the app will crash because <code>fullOrderedMessageArray[(indexPath.row)]</code> contains the nil value. I have no idea why it keeps returning nil for one function while not for the other.</p>