title: Swift and accessing nested JSON collections
body: <p>I am accessing a CMS with a pre-baked JSON output and it uses the following data structure. I am struggling to get down into the nested collections to get the version or loop through the categories.</p>
  
  <pre><code>{
      results: [
          {
              pageData: {
                  info: {
                      version: "1"
                  },
                  categories: [
                      {
                          name: "Cat 1"
                      },
                      {
                          name: "Cat 2"
                      }
                  ]
              }
          }
      ]
  }
  </code></pre>
  
  <p>Here is the code I was attempting to use. Any help is appreciated!</p>
  
  <pre><code>guard let json = json, let results = json["results"], let pageData = results["pageData"], let info = pageData["info"] as? [String:Int], let version = info["version"], 
      let categories = Category.getCategories(json: json) else {
      self.completionParse(RequestResult.errorParsing, self.categoriesResult)
      return
  }
  </code></pre>