Im having a hard time trying to figure out how to correctly sort my Message struct. Below is a function Im using to do so, which isn't working. Im getting an "Argument passed to call that takes no arguments" error returned whenever I try to build.
@objc func handleReloadTable() {
self.messages = Array(self.messagesDictionary.values)
self.messages.sort(by: { (message1, message2) -> Bool in
return message1.timestamp?.int32Value > message2.timestamp?.int32Value
})
DispatchQueue.main.async(execute: {
self.tableView.reloadData()
})
}
A bit frustrating as I've used this same function on multiple projects and I've never had an issue. However, those projects were written in Swift 3.0 and this project is in Swift 4.