diff --git a/128-swift-networking/Guardfile b/128-swift-networking/Guardfile index b821ef5..37bcab5 100644 --- a/128-swift-networking/Guardfile +++ b/128-swift-networking/Guardfile @@ -10,6 +10,6 @@ guard :shell do puts puts puts "Running #{m[0]}" - puts `swift -i #{m[0]} -sdk $(xcrun --show-sdk-path --sdk macosx)` + puts `swift #{m[0]} -sdk $(xcrun --show-sdk-path --sdk macosx)` end end diff --git a/128-swift-networking/networking.swift b/128-swift-networking/networking.swift index e4ab1fc..439b324 100644 --- a/128-swift-networking/networking.swift +++ b/128-swift-networking/networking.swift @@ -2,8 +2,8 @@ import Foundation class Downloader { let url: NSURL - @lazy var config = NSURLSessionConfiguration.defaultSessionConfiguration() - @lazy var session: NSURLSession = NSURLSession(configuration: self.config) + lazy var config = NSURLSessionConfiguration.defaultSessionConfiguration() + lazy var session: NSURLSession = NSURLSession(configuration: self.config) var running = false typealias JSONArrayCompletion = (Array?) -> () @@ -17,13 +17,13 @@ class Downloader { (let data, let response, let error) in if let httpResponse = response as? NSHTTPURLResponse { println("got some data") - switch(httpResponse.statusCode()) { + switch(httpResponse.statusCode) { case 200: println("got a 200") self.parseJson(data, completion: completion) default: - println("Got an HTTP \(httpResponse.statusCode())") + println("Got an HTTP \(httpResponse.statusCode)") } } else { println("I don't know how to handle non-http responses")