title: Check if multi dictionary contains a value Swift 4
body: <p>I want to check if multi dictionary contains a value for example
  Below is all my code:</p>
  
  <pre><code>struct listBuyItem: Codable {
  
      let id: Int
      let beer: String
      let quantity: Int
      let totalPrice: Double
  
  
  }
  
  var cart: [listBuyItem] = [listBuyItem]()
  
  cart.append(listBuyItem(id: beer.id, beer: beer.beerName, quantity: Int((cell?.stepperBeer.value ?? Double(0))), totalPrice: price))
  </code></pre>
  
  <p>how can I check if "id = 1" exist?</p>