title: Swift/Alamofire: Iterating through JSON values to check for bool value?
body: <p>Here is the JSON:</p>
  
  <pre><code> {
    "data": [
      {
        "type": "season",
        "id": "season.1",
        "attributes": {
          "isCurrentSeason": true,
          "isOffseason": false
        }
      },
      {
        "type": "season",
        "id": "season2",
        "attributes": {
          "isCurrentSeason": false,
          "isOffseason": false
        }
      }
  }
  </code></pre>
  
  <p>I am trying to iterate through this JSON data to see if isCurrentSeason is true. If it is true, I need to store the "id" of it. </p>
  
  <p>Here is my current implementation:</p>
  
  <pre><code>Alamofire.request(request).responseJSON { response in
              switch response.result {
  
              case .Success(let _data):
                  print(_data)
                  if let DataObject = _data["data"] as? NSDictionary {
                      if let Attributes = DataObject["attributes"] as? [NSDictionary] {
                          for attribute in Attributes {
                              if Attributes["isCurrentSeason"] = true {
                                  currentSeasonID = Attributes["isCurrentSeason"]
                              }
                          }
                      }
                  }
              default:
                  break;
              }
          }
  </code></pre>
  
  <p>I keep getting the error <code>Pattern cannot match values of type 'Result&lt;Any&gt;'</code> on the case .Success line. So I can't even test if it is pulling the correct data. Not sure if there is a better way to iterate and record through the data.</p>