I'm currently writing like this
static func fromIntervals(intervals: [Interval]) -> ChartData {
let sortedIntervals = intervals.sorted { (a, b) in return a.startTime < b.startTime}
}
But it shows error of
Cannot invoke 'sorted' with an argument list of type '((_, _) -> _)'
I searched for a lot of other code examples, and none of them work, I have no idea why. Any suggestions?