ios - How to search in firebase database? -
i'd make search bar, , if search word, i'd data include word on firebase.
i've implimented search bar , looking have write in func searchbarsearchbuttonclicked(_ searchbar: uisearchbar)
.
so far, have idea. uses "for" , "if" run code data.
for in (~) { let defaultplace = dbref.child("posts/\(i)/age") defaultplace.observe(.value) { (snap: firdatasnapshot) in if ~ { self.displayage.text = (snap.value! anyobject).description } } }
(↑ example. "~" something)
but i'm not sure if it's best way.
ios:
queryordered(bychild: "{field name}").querystarting(atvalue: "{value}")
replace {field name} , {value}
Comments
Post a Comment