|
|
@@ -618,14 +618,13 @@ public class Request {
|
|
|
/**
|
|
|
Adds a handler to be called once the request has finished.
|
|
|
|
|
|
- :param: priority The dispatch priority / quality of service used to process the response handler. `DISPATCH_QUEUE_PRIORITY_DEFAULT` by default.
|
|
|
:param: queue The queue on which the completion handler is dispatched.
|
|
|
:param: serializer The closure responsible for serializing the request, response, and data.
|
|
|
:param: completionHandler The code to be executed once the request has finished.
|
|
|
|
|
|
:returns: The request.
|
|
|
*/
|
|
|
- public func response(priority: Int = DISPATCH_QUEUE_PRIORITY_DEFAULT, queue: dispatch_queue_t? = nil, serializer: Serializer, completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self {
|
|
|
+ public func response(queue: dispatch_queue_t? = nil, serializer: Serializer, completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self {
|
|
|
let delegate = self.delegate
|
|
|
dispatch_async(delegate.queue) { [weak delegate] in
|
|
|
let (responseObject: AnyObject?, serializationError: NSError?) = serializer(self.request, self.response, delegate?.data)
|