huyouare / SwiftParseChat

An Example iOS Chat Application with Parse, written in Swift
317 stars 63 forks source link

Last message fix #2

Open BTopbas opened 9 years ago

BTopbas commented 9 years ago

Hi all; I test this project and i see mine last messages not shown on messages table. Only senders messages shown. So i try fix it and success. Maybe bad method but now i see my mesages too. I added messagescell under the function

    let groupidfix = message[PF_MESSAGES_GROUPID] as String
    var query = PFQuery(className: PF_MESSAGES_CLASS_NAME)
    query.whereKey(PF_MESSAGES_GROUPID, equalTo: groupidfix)
    query.orderByDescending(PF_MESSAGES_UPDATEDACTION)
    query.getFirstObjectInBackgroundWithBlock { (objem: PFObject!, error: NSError!) -> Void in
    self.lastMessageLabel.text = objem[PF_MESSAGES_LASTMESSAGE] as? String
    }

and u need to remove lastMessageLabel.text = message[PF_MESSAGES_LASTMESSAGE] as? String end of file..