title: How to search an Array containing struct elements in Swift?
body: <p>It's kind pretty straight forward to find an element in an array with type String, Int, etc.</p>
  
  <pre><code>var States = ["CA", "FL", "MI"]
  var filteredStates = States.filter {$0 == "FL"} // returns false, true, false
  </code></pre>
  
  <p>Now, I created a struct</p>
  
  <pre><code>struct Candy{
      let name:String
  }
  </code></pre>
  
  <p>and then initialized it</p>
  
  <pre><code>var candies =  [Candy(name: "Chocolate"),
  Candy(name: "Lollipop"),
  Candy(name: "Caramel")]
  </code></pre>
  
  <p>Can anyone please suggest the right way to find "Chocolate" in the array containing struct elements? I'm not able to implement the find or filter method.</p>