title: Check if Dictionary is inside Array of Dictionaries in Swift 3
body: <p>I have an array of dictionaries like this:</p>
  
  <pre><code>var suggestions = [["keyword": "apple", "identifier": "0"], ["keyword": "banana", "identifier": "1"], ["keyword": "carrot", "identifier": "2"]]
  </code></pre>
  
  <p>I would like to append the suggestions array and before I do that, I want to know if the dictionary already exists inside of my array to prevent duplicates. How can I do that in Swift 3?</p>
  
  <p>I tried to use the <code>contains(where: ([String: String)])</code> function for Swift 3 but I can't seem to make it work.</p>
  
  <p><strong>UPDATE:</strong> The answer by Daniel Hall made it work. Here's the exact code for Swift 3:</p>
  
  <pre><code>let newDictionary = ["keyword": "celery", "identifier": "3"]
  if !suggestions.contains(where: {$0 == newDictionary}) {
      suggestions.append(newDictionary)
  }
  </code></pre>