I am trying to retrieve every object stored in Firebase. Not sure how to go ahead. The following is my code and snap.value printed. I need to retrieve String "cbc" and "cp24" as well as values for datesaved and url. "cbc" and "cp24" are names I entered when saving.
My code:
My code:
Code:
Ref_UsersBase.observeEventType(.Value, withBlock:{ snapshot in
if let snapshots = snapshot.children.allObjects as?[FDataSnapshot]{
for snap in snapshots {
print(snap.value)
}
}
})
{
// Here is snap.value printed:
{
"-KGOzXm1lLtyS23cOR-G"= {
cp24 = {
datesaved ="Apr 27, 2016";
url ="https://www.google.ca/search?site=&source=hp&ei=H0chV6pfhKeOBJChpqAN&q=cp24+weather&oq=&gs_l=mobile-gws-hp.1.0.41l2.0.0.0.13343.1.1.0.1.1.0.368.368.3-1.1.0....0...1..64.mobile-gws-hp..0.1.6.2.JC6OI95nuYc";
};
};
"-KGOznhRN0J2OVlIogZ0"= {
cbc = {
datesaved ="Apr 27, 2016";
url ="http://www.cbc.ca/beta/news/canada/toronto";
};
};
}
Last edited by a moderator: