[ad_1]
File JSON with knowledge
{
"city_is_regional" = 0;
id = 19;
"id_locale" = 19;
lang = 1;
"last_edit_time" = 1494940557;
title = "U0428U043aU043bU043eU045e";
area = "Mogilev area";
seen = 1;
},
{
"city_is_regional" = 0;
id = 93;
"id_locale" = 367;
lang = 1;
"last_edit_time" = 1644925878;
title = "U0428U0447U0443U0447U044bU043d";
area = "Grodno area";
seen = 1;
}
learn how to extract an parts title and id individually? I simply know learn how to show the entire date in full, however I don’t know individually
func parseJSON() {
let urlString = "https://krokapp.by/api/get_cities/11/"
AF.request(urlString).responseJSON { responce in
change responce.end result {
case .success:
if let jsonData = attempt? JSONDecoder().decode([City].self, from: responce.knowledge!){
print(jsonData)
} else{
print("error")
}
case .failure(let error):
print(error.localizedDescription)
}
}
}
[ad_2]
