Skip to content

Instantly share code, notes, and snippets.

@GregLukosek
Created March 9, 2015 15:48
Show Gist options
  • Save GregLukosek/6dd2149e5d069f2538c8 to your computer and use it in GitHub Desktop.
Save GregLukosek/6dd2149e5d069f2538c8 to your computer and use it in GitHub Desktop.
Sorting NSDictionary by string date value
let rates = responseDictionary["rates"] as NSDictionary
let stringArray = rates.allKeys as [String]
var dates = Array<NSDate>()
for s in stringArray {
dates.append(dateFormater.dateFromString(s)!)
}
dates.sort({$0.timeIntervalSinceNow < $1.timeIntervalSinceNow})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment