Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. let session = URLSession.shared
  2. session.dataTask(with: url) { (data, response, error) in
  3. if let response = response {
  4. print(response)
  5. }
  6.  
  7. if let data = data {
  8. print(data)
  9. do {
  10. let json = try JSONSerialization.jsonObject(with: data, options: [])
  11. print(json)
  12. } catch {
  13. print(error)
  14. }
  15.  
  16. }
  17. }.resume()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement