guard let searchText = searchController.searchBar.text?.lowercased() else { return }
DBReference.queryOrdered(byChild: "name").queryStarting(atValue: searchText).queryEnding(atValue: searchText+"\u{f8ff}")
.observe(.value, with: {
snapshot in
var newItems: [WordsItem] = []
for item in snapshot.children {
let groceryItem = GroceryItem(snapshot: item as! DataSnapshot)
newItems.append(WordsItem)
}
self.items = newItems
self.tableView.reloadData()
})
اترك تعليقاً