Szybki żądanie adresu URL
import Foundation
let apiUrl = URL(string: "https://api.chucknorris.io/jokes/random")!
let dataTask = URLSession.shared.dataTask(with: apiUrl) { (data, response, error) in
guard let data = data, error == nil else {
print("no data")
}
let jsonResult = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
print(jsonResult["value"])
}
dataTask.resume()
Adventurous Anteater