I have an array, workoutData, of string dates in the format EEEE, d MMM, yyyy so the dates are saved as Tuesday, 30 Apr, 2019, Thursday, 25 Apr, 2019 and Saturday, 27 Apr, 2019 etc. I have tried using the sorted(by:) method below however this orders the dates alphabetically.
let orderedArray = self.workoutData.sorted(by: { $0.compare($1) == .orderedDescending})
How can I order this array in a descending order by date? I would like to keep the individual dates as strings and I am using these to populate a tableView.
Excuse the lack of experience. Thanks