title: Swift Dictionary: Get values as array
body: <p>I have a dictionary containing <code>UIColor</code> objects hashed by an enum value, <code>ColorScheme</code>:</p>
  
  <pre><code>var colorsForColorScheme: [ColorScheme : UIColor] = ...
  </code></pre>
  
  <p>I would like to be able to extract an array of all the colors (the values) contained by this dictionary. I thought I could use the <code>values</code> property, as is used when iterating over dictionary values (<code>for value in dictionary.values {...}</code>), but this returns an error:</p>
  
  <pre><code>let colors: [UIColor] = colorsForColorSchemes.values
                          ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
  'LazyBidrectionalCollection&lt;MapCollectionView&lt;Dictionary&lt;ColorScheme, UIColor&gt;, UIColor&gt;&gt;' is not convertible to 'UIColor'
  </code></pre>
  
  <p>It seems that rather than returning an <code>Array</code> of values, the <code>values</code> method returns a more abstract collection type. Is there a way to get an <code>Array</code> containing the dictionary's values without extracting them in a <code>for-in</code> loop?</p>