0
Alamofire.request(Config.recommendationURL, headers: headers).responseJSON { (responseData) -> Void in
        if((responseData.result.value) != nil) {
            let swiftyJsonVar = JSON(responseData.result.value!)
            if (swiftyJsonVar["success"]).boolValue {
                if let recommendData = swiftyJsonVar["data"].arrayObject {
                    var j = 0
                    for source in recommendData  {
                        if j < 2 {
                            let rcmId = source["_id"]!! as! String
                            j = j + 1
                        }
                    }
                }
            }
        }
    }
}

I don't know why I got following error when I've installed XCode8. Above is complete code of mine.

Type 'Any' has no subscript members in swift3

Naresh
  • 16,698
  • 6
  • 112
  • 113
PPShein
  • 13,309
  • 42
  • 142
  • 227

0 Answers0