I have an array like this:
selectedMarks : [StatDetails] = [
StatDetails(dateRanges: [2015-05-29 09:30:00 +0000, 2015-05-29 10:30:00 +0000], hours: 1),
StatDetails(dateRanges: [2015-06-16 08:00:00 +0000, 2015-06-16 09:00:00 +0000], hours: 1),
StatDetails(dateRanges: [2015-06-10 15:00:00 +0000, 2015-06-10 16:00:00 +0000], hours: 1)]
As you can see, selectedMarks is an array of "StatDetails" that contains 2 parameters:
1: dateRanges": an array of NSDate
2: hours: an Integer
I'm trying to figure out how to sort this array of StatDetails by the first element of the dateRanges array.
I tried with this but no success:
selectedMarks.sortInPlace({ $0.dateRanges < $1.dateRanges })
Any help with that??