Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if let url = URL(string: urlString){
- let task = URLSession.shared.dataTask(with: url) { (data, respose, error) in
- if let data = data{
- do{
- let photoResults = try JSONDecoder().decode([Photos].self, from: data)
- print(photoResults)
- } catch {
- print(error)
- }
- }
- }
- task.resume()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement