title: Swift - Check if array contains element with property
body: <p>I have an array of custom objects.</p>
  
  <p>I want to check if array contains an object, which property is equal to string.</p>
  
  <p>Something like </p>
  
  <pre><code> if array.contains(object where object.name == name) {
       // do something
   } else {
       // don't do something
   }
  </code></pre>
  
  <p>How to do in Swift?</p>