title: Split dictionaries in two array and sort the dictionary by value swift
body: <p>1) this is first step : I'm asking how to make this dictionary in order by value.</p>
  
  <p>2)second step: I want to split this dictionary in two array, one for value and one for keys thanks </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>["fruit": 1, "vegie": 13, "money": 46, "Canada": 219, "cash": 1, "lola": 1, "tv": 2, "bed": 1, "sofa": 1]</code></pre>
  </div>
  </div>
  </p>
  
  <p>I did something like that but I want to split in two arrays now</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let byValue = {
      (elem1:(key: String, val: Int), elem2:(key: String, val: Int))-&gt;Bool in
      if elem1.val &lt; elem2.val {
          return true
      } else {
          return false
      }
  }
  let sortedDict = dict.sort(byValue)</code></pre>
  </div>
  </div>
  </p>