updateSearchResults function iOS search in tableview by searchController

 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()
      })
الصورة الرمزية لـ admin

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *