title: Sort Dictionary by Key Value
body: <pre><code>let dict: [String:Int] = ["apple":5, "pear":9, "grape":1]
  </code></pre>
  
  <p>How do you sort the dictionary based on the <code>Int</code> value so that the output is:</p>
  
  <pre><code>sortedDict = ["pear":9, "apple":5, "grape":1]
  </code></pre>
  
  <h3>Current Attempt (doesn't sort correctly):</h3>
  
  <pre><code>let sortedDict = sorted(dict) { $0.1 &gt; $1.1 } 
  </code></pre>