title: didSelectRowAtIndexPath index path with uisearchcontroller
body: <p>I have an application when the user clicks on a cell it will open another viewController and I just add a <code>uisearchcontroller</code> on my tableview.</p>
  
  <p>When I am searching on the tableview the result is correct ,
  but when I click on the cell after filtering , it opens the wrong page.</p>
  
  <p>My problem is I don't now how to identify the <code>indexpath</code> when the <code>uiviewcontroller</code> is active to make the result open correct page </p>
  
  <pre><code>   func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
  
          IndexPathRow = indexPath.row
  
  
          performSegueWithIdentifier("toView2", sender: self)
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>I solved my problem by adding new variable in the struct of type integer and then modify didSelectRowAtIndexPath function to </p>
  
  <pre><code>   func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
  
  if resultSearchController.active &amp;&amp; resultSearchController.searchBar.text != ""{
  
        IndexPathRow = filteredData[indexPath.row].i
      }
  
      else {
          IndexPathRow = indexPath.row
  
      }
  
      performSegueWithIdentifier("toView2", sender: self)
  
      }
  </code></pre>