title: Fetch all values for a particular key from a Dictionary in Swift
body: <p>I have a array of dictionary like this.</p>
  
  <pre><code>let arr = [["EmpName"   :   "Alex",     "Designation"   :   "Jr. Developer"],
             ["EmpName"   :   "Bob",     "Designation"   :   "Sr. Developer"],
             ["EmpName"   :   "Claire",  "Designation"   :   "Jr. Developer"],
             ["EmpName"   :   "David",   "Designation"   :   "Project Manager"]]
  </code></pre>
  
  <p>Now I want to fetch only the <code>EmpName</code> objects from this. How do I do this in swift? I basically want an array which have the following values.</p>
  
  <pre><code>["Alex", "Bob", "Claire", "David"]
  </code></pre>
  
  <p>This is what I do now. But I wonder if I could do that in a single like by using <code>filter</code> or <code>map</code>...</p>
  
  <pre><code>var employees = [String]()
      for empRecord in arr {
          employees.append(empRecord["EmpName"]!)
      }
  </code></pre>