I am making a chat room app and trying to make it so that once every hour has passed all the messages that were sent during that time gets deleted forever...
I have this so far, any help would be much appreciated!
for message in json["Messages"].arrayValue {
let newMessage = Message(data: message)
if newMessage.sentTime = > 1 hour {
self.filterMessages(newMessage)
}
}