title: Comparing dictionary values swift
body: <p>I have an array of dictionaries of type </p>
  
  <pre><code>[["OptionId": 824, "QuestionId": 208],
  ["OptionId": 810, "QuestionId": 205],
  ["OptionId": 1017, "QuestionId": 257],
  ["OptionId": 0, "QuestionId": 201],
  ["OptionId": 0, "QuestionId": 199],
  ["OptionId": 0, "QuestionId": 200]]
  </code></pre>
  
  <p>I have iterated through these values and extracted the dictionaries values as </p>
  
  <pre><code>["OptionId": 824, "QuestionId": 208]
  ["OptionId": 810, "QuestionId": 205]
  ["OptionId": 1017, "QuestionId": 257]
  ["OptionId": 0, "QuestionId": 201]
  ["OptionId": 0, "QuestionId": 199]
  ["OptionId": 0, "QuestionId": 200]
  </code></pre>
  
  <p>Now, I want to get the "QuestionId" for all those "OptionId" which are 0. How can I compare the dictionary key-value to zero? Thanks in advance.</p>
  
  <p>This is what I have tried so far:</p>
  
  <pre><code>for dictionary in arrayofDict {
      print(dictionary)
      if (dictionary["OptionId"] == 0) {
          print("option not selected")
      }
  } 
  </code></pre>