xcode7になってAlamofire-SwiftyJSONがエラーになる件
一旦、これに書き換えてみたメモ。
public func responseSwiftyJSON(queue: dispatch_queue_t? = nil, options: NSJSONReadingOptions = .AllowFragments, completionHandler: (NSURLRequest, NSHTTPURLResponse?, JSON, NSError?) -> Void) -> Self { return response(queue: queue) { (request, response, object, error) -> Void in dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { var responseJSON: JSON if error != nil || object == nil{ responseJSON = JSON.nullJSON } else { responseJSON = SwiftyJSON.JSON(object!) } dispatch_async(queue ?? dispatch_get_main_queue(), { completionHandler(request!, response, responseJSON, error) }) }) } } }
そもそも使わないという選択肢もありな気がしてきた今日このごろ。