Using firebaseArray, is it possible to order by a specified child key: (https://www.firebase.com/docs/web/guide/retrieving-data.html#section-queries)?
var fi
Here is how you can order by date. Just use queryOrderedByChild(dateKey) and it will be in asc order, to make desc you can do array.reverse()
POST_REF.queryOrderedByChild(PostKeys.kPostDate).observeEventType(.Value, withBlock: {
snapshot in
var localPosts = [Post]()
for item in snapshot.children {
let postItem = Post(snapshot: item as! FDataSnapshot)
localPosts.append(postItem)
}
//Display at desc order
let reverseResults = localPosts.reverse() as [Post]
completion(postsArray: reverseResults)
}, withCancelBlock: { error in
completion(postsArray: nil)
})