NSScreencast Episode #128 Swift Networking
Swift Networking - NSScreencast
- let task = session.dataTaskWithURL(url) {
- (let data, let response, let error) in
- if let httpResponse = response as? NSHTTPURLResponse {
- self.running = false
- running = true
- task.resume()
- (let data, let response, let error) in
- class Downloader
- init _ url: String
- optional
- init _ url: String
- lazy initialize (initialize on first time call)
- @lazy var config = NSURLSessionConfiguration.defaultSessionConfiguration()
- @lazy var session: NSURLSession = NSURLSession(configuration: self.config)
- typealias
- typealias JSONArrayCompletion = (Array?) -> ()
- AnyObject The Swift Programming Language: Type Casting
- Array
- NSArray for untyped data
- Array
- closure