Andrés Leal
Andrés Leal
9,563 Points

How to parse JSON with swiftyJSON

I am trying again and again to parse the thumbnail path address from this JSON

"data":{ "offset":0, "limit":20, "total":1491, "count":20, "results":[
"id":1011334, "name":"3-D Man", "description":"", "modified":"2014-04-29T14:18:17-0400", "thumbnail":{
"path":"http://i.annihil.us/u/prod/marvel/i/mg/c/e0/535fecbbb9784", "extension":"jpg" },

But I can't seem to have found the answer to my question. I am doing this:

for (key, subJson) in json["data", "results", "thumbnail", "path", 0] { if let imagePath = subJson["path"].string { print(imagePath) let finalImagePath = imagePath + "somestring with my priv key and pub key" print(finalImagePath) } }

I would much appreciate if someone give me the answer to this, I have been struggling for so long now.

Thanks in advance