title: iOS Crash error indexPath out of bounds when searching in TableView
body: <p>I have 2 arrays, one is base contains 532 elements and other one is filter array. I have <code>UISearchBar</code> which has delegate method</p>
  
  <pre><code>func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
      self.filter(searchText: searchText)
  }
  
  private func filter(searchText: String) {
      if searchText.isEmpty {
          self.filterDelegates = self.delegates
      } else {
          self.filterDelegates = self.delegates.filter {
              $0.delegate.fullName.lowercased().contains(searchText.lowercased())
          }
      }
      self.tableView.reloadData()
  }
  </code></pre>
  
  <p>when I scroll tableview and start searching it crashes, It's not resetting indexPath on <code>self.tableView.reloadData()</code> Method</p>
  
  <p>Logs in CellforRow at indexpath</p>
  
  <pre><code>INDEXPATH : 23
  FILTER COUNT : 396
  INDEXPATH : 22
  FILTER COUNT : 20
  
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(
              withIdentifier: DelegateTableViewCell.defaultReuseIdentifier
          ) as! DelegateTableViewCell
          print("INDEXPATH : \(indexPath.row)")
          print("FILTER COUNT : \(self.filterDelegates.count)")
          cell.item = self.filterDelegates[indexPath.row] // Index out of bound
          return cell
      }
  </code></pre>
  
  <p>Also I'm using same filter array for no. of rows method</p>
  
  <pre><code>func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return self.filterDelegates.count
  }
  </code></pre>
  
  <p>What's wrong I'm doing?</p>