title: Convert dictionary to array - Swift 5
body: <p>I have the following dictionary:</p>
  <pre><code>@Published var walletsTokenData: [Wallet: [TokenBalanceClassAModel]] = [:]
  </code></pre>
  <p>Once I populate the value from the API, I want to iterate through each Wallet element, call it <code>a, b, c</code>. The problem is that diccionaries are unorder and I need to do a lot of iterations and searching in my views so I thought a better idea is instead of having a diccionary, having an array so I'm also able to do in the view <code>ForEach(walletsTokenData.address) { address in</code></p>
  <p>How can I convert that diccionary into an array?</p>
  <p>I tried something like:</p>
  <pre><code>@Published var x: [[[Wallet][TokenBalanceClassAModel]] = []
  </code></pre>
  <p>but it just looks weird. Is that even correct? I need to be able to link 1 wallet (I called it <code>a</code> above) to multiple items, then <code>b</code> to multiple items but a and b and their items being unrelated.</p>
  <p>I understand I have a weak spot in data structures, that's why I'm seeking help :)</p>
  <p>I tried this for the dictionary:</p>
  <pre><code>ForEach(walletsTokenData.keys, id: \.self) { key in
  </code></pre>
  <p>but it says:</p>
  <pre><code>Generic struct 'ForEach' requires that 'Dictionary&lt;Wallet, [TokenBalanceClassAModel]&gt;.Keys' conform to 'RandomAccessCollection'
  </code></pre>
  <p>I just think an array would make more sense</p>