title: Swift turn an Array into a grouped Dictionary
body: <p>I have an Array of <code>Transaction</code> objects</p>
  
  <pre><code>var returnedArray: Array&lt;Transaction&gt; = [a, b, c, d]
  </code></pre>
  
  <p>One of the properties of <code>Transaction</code> is an <code>NSDate</code>. I want to convert my Array into a Dictionary </p>
  
  <pre><code>var transactions: [NSDate: Array&lt;Transaction&gt;]
  </code></pre>
  
  <p>Where all the transactions on that date will be in an Array that has the date as the key. </p>
  
  <p>I know how to loop through each element of my array and manually assign it to the right key but i'm wondering if there is an elegant function to do that.</p>