How to loop through JSON with SwiftyJSON?

后端 未结 5 1971
一向
一向 2020-12-13 08:59

I have a json that I could parse with SwiftyJSON :

if let title = json[\"items\"][2][\"title\"].string {
     println(\"title : \\(title)\")
}
5条回答
  •  情歌与酒
    2020-12-13 09:42

    Please check the README

    //If json is .Dictionary
    for (key: String, subJson: JSON) in json {
       //Do something you want
    }
    
    //If json is .Array
    //The `index` is 0..

提交回复
热议问题