title: How to sort dictionary by value?
body: <p>My dictionary like this:</p>
  
  <pre><code>var items = [Int: [String]]() 
  var itemsResult = [Int: [String]]()
  </code></pre>
  
  <p>itmesResult stores the data downloaded from server.
  and pass the data to items use of items = itmesResult</p>
  
  <p>the value has 3 elements like ["Apple","/image/apple.png","29"]
  and I want to sort the dictionary by first value which is Apple.</p>
  
  <pre><code>for (k,v) in (itemsResult.sorted(by: { $0.value[0] &lt; $1.value[0] })) { 
    items[k] = v
  }
  </code></pre>
  
  <p>The result of above code is not my expectation.</p>
  
  <p>I would like to sort it alphabetically how can I do this?</p>
  
  <p>Edit:</p>
  
  <p>origin:</p>
  
  <pre><code>1:["Apple","/image/apple.png","29"]
  2:["AAA","/image/aaa.png","29"]
  3:["Banana","/image/banana.png","29"]
  </code></pre>
  
  <p>sorted:</p>
  
  <pre><code>2:["AAA","/image/aaa.png","29"]
  1:["Apple","/image/apple.png","29"]
  3:["Banana","/image/banana.png","29"]
  </code></pre>
  
  <p>I would like to sort it by first value.</p>