I have a dictionary, [String : Double]
with the following data:
Museum1 : 8785.8971799638
Museum2 : 34420.9643422388
Museum3 : 826.467789130732
Museum4 : 304120.342151219
I'd like to sort the dictionary by the double value. I did some research, but all of the examples are deprecated for the current version of Swift
I've tried using this code from Sort Dictionary by values in Swift:
for (k,v) in Array(self.museumsDic).sorted({$0.0 < $1.0}) {
println("\(k):\(v)")
}
But it doesn't work. How can I sort the dictionary by its values?