title: Use .filter with array of dictionaries in Swift
body: <p>I have an array called <code>master</code> and it is of type <code>Array&lt;Dictionary&lt;String, String&gt;&gt;()</code>. I am trying to use the filter function, like this:</p>
  
  <pre><code>filteredMusic = allSongNames.filter({ (song: String) -&gt; Bool in
      let stringMatch = song.rangeOfString(searchText, options: NSStringCompareOptions.CaseInsensitiveSearch)
      return stringMatch != nil
  })
  </code></pre>
  
  <p>Where <code>filteredMusic</code> and <code>allSongNames</code> are both arrays of String. I try to translate this with my <code>master</code> array, and <code>masterFilter</code> (same type as <code>master</code>):</p>
  
  <pre><code>masterFilter = master.filter({ (song: String, id: String) -&gt; Bool in
      let stringMatch = song.rangeOfString(searchText, options: NSStringCompareOptions.CaseInsensitiveSearch)
      return stringMatch != nil
  })
  </code></pre>
  
  <p>My error:</p>
  
  <pre><code>'(String, String) -&gt; Bool' is not convertible to '([String : String]) -&gt; Bool'
  </code></pre>
  
  <p>I must be messing up syntax. What is the correct syntax?</p>