Im using the search bar to filter data from the database and will populate the tableView. Im getting an error on the isSearching part.
Value of type 'DataSnapshot' has no member 'contains'
Heres the code.
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
if searchBar.text == nil || searchBar.text == "" {
isSearching = false
view.endEditing(true)
tableView.reloadData()
} else {
isSearching = true
filteredColorRequests = colors.filter{$0.contains(searchBar.text!)}
tableView.reloadData()
}
}
How