[ad_1]
I am trying to save all names from a json url to a list but it doesn’t work.
I am using this code:
let jsonUrl = ("https://de1.api.radio-browser.info/json/stations/byname/jazz")
Alamofire.request( jsonUrl).responseJSON { (responseData) -> Void in
if((responseData.result.value) != nil) {
let swiftyJsonVar = JSON(responseData.result.value!)
for (_, subJson):(String, JSON) in swiftyJsonVar {
for (_, subJson):(String, JSON) in subJson {
let nameList = subJson["name"].stringValue
print(nameList)
}
}
}
}
What can I do to fix it?
[ad_2]