SWIFT 2 - Sort Multi dimensional array by date
问题 I am trying to sort my array by date, I have been trying almost everything but with no results. This is the closer I got but I get a waring: Constant 'sortedDate' inferred to have type () var Names = [[String]]() Names = [ ["aaa", "bob", "ccc", "26-10-2015 17:50"], ["aaa-1", "bbb-1", "ccc-1", "22-10-2015 11:20"], ["aaa-2", "bbb-2", "bbb-2", "01-03-2015 17:00"] ] let sortedDate = Names.sortInPlace({ return $0[3].compare($1[3]) == NSComparisonResult.OrderedAscending }) print("\(sortedDate)")