Alamofire & SwiftyJson (Решено)


#1

Друзья добрый день
Во время обучения по курсу Ивана API, захотелось пройтись по JSON. Выбрал Instagram. Сам JSON я получаю Вот код

Alamofire.request("https:##########", method: .get, encoding: JSONEncoding.default)
        .responseJSON { response in
            debugPrint(response)

            if let data = response.result.value{

                if  (data as? [[String : AnyObject]]) != nil{

                    if let dictionaryArray = data as? Array<Dictionary<String, AnyObject?>> {
                        if dictionaryArray.count > 0 {

                            for i in 0..<dictionaryArray.count{

                                let Object = dictionaryArray[i]
                                if let dUrl = Object["display_url"] as? String{
                                    print("Find: \(dUrl)")
                                }
                                if let id = Object["id"] as? String{
                                    print("User Id: \(id)")
                                }
                            }
                        }
                    }
                }
            }
            else {
                let error = (response.result.value  as? [[String : AnyObject]])
                print(error as Any)
            }
    }