Skip to content

Commit

Permalink
Added initializer to GenericResponseSerializer to fix initialization …
Browse files Browse the repository at this point in the history
…bug.
  • Loading branch information
cnoon committed Jul 24, 2015
1 parent 451b97e commit 1978c2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/ResponseSerialization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ public struct GenericResponseSerializer<T>: ResponseSerializer {

/// A closure used by response handlers that takes a request, response, and data and returns a serialized object and any error that occured in the process.
public var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?) -> (SerializedObject?, NSError?)

/**
Initializes the `GenericResponseSerializer` instance with the given serialize response closure.

:param: serializeResponse The closure used to serialize the response.

:returns: The new generic response serializer instance.
*/
public init(serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?) -> (SerializedObject?, NSError?)) {
self.serializeResponse = serializeResponse
}
}

// MARK: - Default
Expand Down

0 comments on commit 1978c2c

Please sign in to comment.