title: Swift sort dictionary by value
body: <p>I have a dictionary, <code>[String : Double]</code> with the following data:</p>
  
  <pre><code>Museum1 : 8785.8971799638
  Museum2 : 34420.9643422388
  Museum3 : 826.467789130732
  Museum4 : 304120.342151219
  </code></pre>
  
  <p>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</p>
  
  <p>I've tried using this code from <a href="https://stackoverflow.com/questions/24090016/sort-dictionary-by-values-in-swift">Sort Dictionary by values in Swift</a>:</p>
  
  <pre><code>for (k,v) in Array(self.museumsDic).sorted({$0.0 &lt; $1.0}) {
      println("\(k):\(v)")
  }
  </code></pre>
  
  <p>But it doesn't work. How can I sort the dictionary by its values?</p>