title: Loop through JSON with SwiftyJSON and Alamofire
body: <p>I have had a look at the other questions but I cant seem to find one that answers my question. </p>
  
  <p>I have this Json file:</p>
  
  <pre><code>[
  "posts",
  {
    "2015": [
      "post title one"
    ],
    "2016": [
      "post title one",
      "post title two"
    ]
  }
  ]
  </code></pre>
  
  <p>and I have this code in my Swift File: </p>
  
  <pre><code>Alamofire.request(.GET, url).validate().responseJSON { response in
          switch response.result {
          case .Success:
              if let value = response.result.value {
                  let json = JSON(value)
                  for (key, subJson) in json["posts"] {
                      if let year = subJson.string {
                          print(year)
                      }
                  }
              }
          case .Failure(let error):
              print(error)
          }
      }
  </code></pre>
  
  <p>I can get the json from the server ok.</p>
  
  <p>On this line:</p>
  
  <pre><code>for (key, subJson) in json["posts"] {
  </code></pre>
  
  <p>I get this error: </p>
  
  <blockquote>
    <p>immutable value 'key' was never used, consider replaying with '_' or removing it</p>
  </blockquote>
  
  <p>I tried that, and tried removing it - still nothing displays in the console. </p>
  
  <p>Also, on this line: </p>
  
  <pre><code>if let year = subJson.string {
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Value of tuple type 'Element' (aka '(String, JSON)') has no member 'string'</p>
  </blockquote>
  
  <p>What I want to do is this: </p>
  
  <p>Loop through all the years and put them in a uitableview. Can someone help?</p>