title: Filter not working for searchbar UITextField in tableView Swift
body: <p>I have implemented searchbar(UITextField) for tableView and defined same array of <code>SectionList</code> but exactly no idea filtering is not working. when I try to print <code>IndexData</code> it has data but <code>tableFilterData</code> is empty.</p>
  
  <blockquote>
    <p>This is the main line which shows empty. 
    <code>tableFilterdata =  IndexData.filter({$0.names.contains(searchText) })</code></p>
  </blockquote>
  
  <pre><code>var IndexData = [SectionList]()`
  
  var tableFilterdata = [SectionList]()`
  
  var isSearch : Bool! = false`
  
  
  struct SectionList {
          let letter : String
          let names : [String]
      }
  </code></pre>
  
  <p>Main Functions</p>
  
  <pre><code>func textFieldShouldReturn(_ textField: UITextField) -&gt; Bool {
         searchTxt.resignFirstResponder()
         return true
      }
  
  public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool{
  
          let searchText  = searchTxt.text! + string
  
          print(IndexData)
  
          tableFilterdata =  IndexData.filter({$0.names.contains(searchText) })
  
          print(tableFilterdata)
          if(tableFilterdata.count == 0){
             isSearch = false
           }else{
             isSearch = true
          }
  
  
          tableView.reloadData()
          return true
      }
  </code></pre>