1
I have the following request that returns me a json I cannot catch the live ulrs
Alamofire.request(urlRequest).validate().responseJSON { response in
print(response.data)
do {
if let data = response.data,
let json = try JSONSerialization.jsonObject(with: data) as? [String: Any],
let live = json["live"] as? [[String: Any]] {
for live in live {
if let livesUrl = live["live"] as? String {
self.urlLive.append(liveUrl)
}
}
}
} catch {
print("Error deserializing JSON: \(error)")
}
print(self.urlLive)
}
JSON REQUEST ME RETURNS
[ { "id": "1", "Description": "TEST 1", "live": "https://....", "Thumb": "https://....", "online": true }, { "id": "2", "Description": "TEST 2", "live": "https://....", "Thumb": "https://....", "online": true }]
Pq Voce does not use Codable Protocol instead of manually parsing your JSON?
– Leo Dabus
has an example of how to use?
– João Vitor