swift3 - How to compare different values in firebase? -
i have 2 models, user , post , function observing posts. need send post on user feed, comparing data, example:
if user.location == post.location & user.interest == post.interest {print("post.id")}
models:
class user { var name: string? var location: string? var interest: string? } class post { var name: string? var location: string? var interest: string? }
function:
func loadposts() { self.tableview.reloaddata() // self.activityindicatorview.startanimating() api.feed.observefeed(withid: api.user.current_user!.uid) { (post) in guard let postid = post.uid else { return } self.fetchuser(uid: postid, completed: { self.posts.insert(post, at: 0) self.activityindicatorview.stopanimating() self.tableview.reloaddata() }) } }
Comments
Post a Comment