title: Double tap on cell in UITableview to perform segue
body: <p>I am attempting to have the user segue to another view controller when tapping a cell. Currently I have my cell segue set up by doing the control drag in the story board to my view controller and then passing in the following code for a <code>prepare(for segue...)</code>. Basically, there are my guard statements confirming I have the correct view controller and then I pass an object between them. </p>
  
  <pre><code>override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
       super.prepare(for: segue, sender: sender)
  
       switch(segue.identifier ?? "") {
  
       case "ShowEventDetailsSegue":
          guard let navVC = segue.destination as? UINavigationController else {
              fatalError("Unexpected destination: \(segue.destination)")
          }
  
          guard let EventDetailViewController = navVC.viewControllers.first as? EventViewController else {
              fatalError("Unexpected navigation view controller: \(String(describing: navVC.viewControllers.first))")
          }
  
          guard let selectedEventCell = sender as? EventTableViewCell else {
              fatalError("Unexpected sender: \(String(describing: sender))")
          }
  
          guard let indexPath = tableView.indexPath(for: selectedEventCell) else {
              fatalError("The selected cell is not being displayed by the table")
          }
  
          let selectedEvent = events[indexPath.section]
          EventDetailViewController.event = selectedEvent
  
  
           default:
              fatalError("Unexpected Segue Identifier; \(String(describing: segue.identifier))")
       }
   }
  </code></pre>
  
  <p>I know that other people recommend calling something like </p>
  
  <pre><code>DispatchQueue.main.async { 
      self.present(myVC, animated: true, completion: nil)
  }
  </code></pre>
  
  <p>(see <a href="https://stackoverflow.com/a/22173620/10177987">here</a> and <a href="https://stackoverflow.com/questions/20320591/uitableview-and-presentviewcontroller-takes-2-clicks-to-display">also here</a>)</p>
  
  <p>but when I do that, <strong>I get an error  "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller".</strong>  </p>
  
  <p>Basically, I want to be able to have the user only click one time on the cell and still be able to pass data over to the other view controller.</p>
  
  <p>What is also strange is that this just started happening. I did not have this issue before today. </p>