title: Swift: Flatten an array of dictionaries to one dictionary
body: <p>In Swift, I am trying to flatten an array of dictionaries into one dictionary
  i.e</p>
  
  <pre><code>let arrayOfDictionaries = [["key1": "value1"], ["key2": "value2"], ["key3": "value3", "key4": "value4"]]
  
  
  //the end result will be:   
   flattenedArray = ["key1": "value1", "key2": "value2", "key3": "value3", "key4": "value4"]
  </code></pre>
  
  <p>I have tried using flatmap, but the type of the returned result is <code>[(String, AnyObject)]</code> and not <code>[String, Object]</code> ie</p>
  
  <pre><code>let flattenedArray = arrayOfDictionaries.flatMap { $0 }
  // type is [(String, AnyObject)]
  </code></pre>
  
  <p>So I have 2 questions:</p>
  
  <ul>
  <li><p>Why is type  [(String, AnyObject)] returned? And what do the brackets mean?</p></li>
  <li><p>How do I achieve the desired result?</p></li>
  </ul>
  
  <p>Edit: I would prefer to use a functional approach with Swift's map/flatmap/reduce etc. instead of a for-loop</p>