Skip to content

Commit

Permalink
[Issue Alamofire#230] Making response object example initializer fail…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
mattt committed Nov 23, 2014
1 parent 69e626f commit b5d6f58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ Generics can be used to provide automatic, type-safe response object serializati

```swift
@objc public protocol ResponseObjectSerializable {
init(response: NSHTTPURLResponse, representation: AnyObject)
init?(response: NSHTTPURLResponse, representation: AnyObject)
}

extension Alamofire.Request {
Expand All @@ -514,7 +514,7 @@ extension Alamofire.Request {
}

return response(serializer: serializer, completionHandler: { (request, response, object, error) in
completionHandler(request, response, object as? T, error)
completionHandler(request, response, object, error)
})
}
}
Expand All @@ -525,7 +525,7 @@ final class User: ResponseObjectSerializable {
let username: String
let name: String

required init(response: NSHTTPURLResponse, representation: AnyObject) {
required init?(response: NSHTTPURLResponse, representation: AnyObject) {
self.username = response.URL!.lastPathComponent
self.name = representation.valueForKeyPath("name") as String
}
Expand Down

0 comments on commit b5d6f58

Please sign in to comment.