SHARE
TWEET

Untitled

a guest Aug 25th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if let url = URL(string: urlString){
  2.            
  3.             let task = URLSession.shared.dataTask(with: url) { (data, respose, error) in
  4.                
  5.                 if let data = data{
  6.                     do{
  7.                         let photoResults = try JSONDecoder().decode([Photos].self, from: data)
  8.                         print(photoResults)
  9.                     } catch {
  10.                         print(error)
  11.                     }
  12.                 }
  13.             }
  14.             task.resume()
  15.      }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top