Created
April 1, 2016 10:30
-
-
Save paulw11/90834a063d8e5ac715b8ed064e00544e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 XCPlayground | |
| import Foundation | |
| XCPlaygroundPage.currentPage.needsIndefiniteExecution=true | |
| var imageURL = NSURL(string : "https://www.nasa.gov/sites/default/files/wave_earth_mosaic_3.jpg") | |
| if let url = imageURL{ | |
| let task = NSURLSession.sharedSession().dataTaskWithURL(url, completionHandler: { (data, response, error) in | |
| if (error != nil) { | |
| print("The error is \(error!)") | |
| } else { | |
| if let theData=data { | |
| print("The data length is \(theData.length)") | |
| } | |
| } | |
| }) | |
| task.resume() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment