Created
March 9, 2015 15:48
-
-
Save GregLukosek/6dd2149e5d069f2538c8 to your computer and use it in GitHub Desktop.
Sorting NSDictionary by string date value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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