title: swiftyJSON grab random index from Array
body: <p>The array contained in the key "children" contains 100 items.</p>
  
  <p>Is there away to tell SwiftyJSON to grab a random index? I tried creating a random number</p>
  
  <pre><code>var random = arc4random_uniform(24)
  </code></pre>
  
  <p>but when I inserted random I got the error: </p>
  
  <p>"Cannot subscript a value of type 'JSON' with an index of type 'UInt32'"</p>
  
  <p>I also converted it to an NSNumber and same thing, I'm completely lost.</p>
  
  <pre><code>func getBackgoundImageData(completed: @escaping DownloadComplete) {
  
      let imageURL = URL(string: IMAGE_URL)!
      Alamofire.request(imageURL).responseJSON { response in
  
          switch response.result {
  
          case .success(let value):
  
              let json = JSON(value)
              if let url = json["data"]["children"][0]["data"]["preview"]["images"][0]["source"]["url"].string {
                  self._backgroundImageURL = url
              }
  
          case .failure(let error):
              print(error)
          }
          completed()
      }   
  }
  </code></pre>