Friday, May 1, 2026
HomeiOS Developmentios - learn how to extract a single json object right into...

ios – learn how to extract a single json object right into a separate array?

[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]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments