title: Reddit: JSON Parsing in swift 3
body: <p>I'm trying to find a way to parse through some Json data on reddit and display the information in a table view. (<a href="https://api.reddit.com" rel="nofollow noreferrer">https://api.reddit.com</a>). 
  So far this is what my code looks like:</p>
  
  <pre><code>var names: [String] = []
  var comment: [String] = []
  
  override func viewDidLoad() {
          super.viewDidLoad()
  let url = URL(string: "https://api.reddit.com")
          do{
              let reddit = try Data(contentsOf: url!)
              let redditAll = try JSONSerialization.jsonObject(with: reddit, options: JSONSerialization.ReadingOptions.mutableContainers) as! [String : AnyObject]
              if let theJSON = redditAll["children"] as? [AnyObject]{
                  for child in 0...theJSON.count-1 {
                      let redditObject = theJSON[child] as! [String : AnyObject]
  
                      names.append(redditObject["name"] as! String)
                  }
              }
              print(names)
          }
  
          catch{
              print(error)
          }
      }
  
  //Table View
  func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
  
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return names.count
      }
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath)
  
          //Configure cells...
          cell.textLabel?.text = names[indexPath.row]
          cell.detailTextLabel?.text = comments[indexPath.row]
  
  
          return cell
      }
  </code></pre>
  
  <p>I know for a fact, the information is actually coming through the "redditALL" constant but i'm not sure what i'm doing incorrect after the JSONSerialization.
  Also, i would really appreciate it if there was some kind of link to help me understand JSON Parsing in swift better, Thanks.</p>