Created
February 11, 2018 19:48
-
-
Save amadeu01/6e5a1f56ed7abfdd0a50cde0801bec23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import Foundation | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
let url = URL(string: "http://www.google.com/")! | |
let task = URLSession.shared.dataTask(with: url) { data, response, error in | |
if let error = error { | |
print(error) | |
return | |
} | |
print(response) | |
} | |
task.resume() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment