title: How to group array data based on Date item into a dictionary
body: <p>I have an array of <code>Item</code> objects:</p>
  
  <pre><code>struct Item {
     let date: Date
     let amount: Double
  }
  </code></pre>
  
  <p>How can I group this items into a dictionary with <code>Date</code> as key and sum of <code>amount</code> for that date in Swift 3 ?</p>
  
  <p>Here is an example:</p>
  
  <pre><code>let data = [Item(date:"2017.02.15", amount: 25), 
              Item(date:"2017.02.14", amount: 50), 
              Item(date:"2017.02.11", amount: 35), 
              Item(date:"2017.02.15", amount: 15)]
  </code></pre>
  
  <p>Result should be:</p>
  
  <pre><code>["2017.02.15": 40, "2017.02.14": 50, "2017.02.11": 35]
  </code></pre>