amadeu01
2/11/2018 - 7:48 PM

NSURLSession_Example.swift

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()