Skip to content

Instantly share code, notes, and snippets.

@chuganzy
Last active March 4, 2016 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuganzy/193ec066aa27ff6480e8 to your computer and use it in GitHub Desktop.
Save chuganzy/193ec066aa27ff6480e8 to your computer and use it in GitHub Desktop.
import Foundation
import APIKit
import Himotoki
extension RequestType where Response: Decodable, Response.DecodedType == Response {
func responseFromObject(object: AnyObject, URLResponse: NSHTTPURLResponse) -> Response? {
return try? decode(object)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment