retrieving the data from firebase database and manipulate it in swift -


it's been while have started working firebase database. here code :

let fbref = firebase(url: "https://mylogin-fb.firebaseio.com")         var gatherdata = fbref.observeeventtype(.childadded, withblock: {             snapshit in             print(snapshit.value)              }, withcancelblock: {          error in                 print(error.description)          }) 

and here results :

{     "detail " = swift;     "title  " = programming; } 

how can "swift" or "programming" ????

use objectforkey retrieve data.

in case :

let title = snapshot.value.objectforkey("title") let detail = snapshot.value.objectforkey("detail")  print("title : \(title), detail : \(detail)") 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -