I have a message
array. Each message has a timestamp
property that's an Int
. I'm trying to sort out the array based on the most recent date, but I'm getting an error saying:
Value of type 'Int' has no member 'intValue'
self.messages.sort(by: { (message1, message2) -> Bool in
return message1.timestamp!.intValue > message2.timestamp!.intValue
})