Created
January 16, 2016 15:42
-
-
Save raulriera/0870d0a52fa25d0e594f to your computer and use it in GitHub Desktop.
Example of the Medium article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct UserRequest: DribbbleRequestType { | |
public typealias Response = User | |
public var path: String { | |
return "/user" | |
} | |
public func responseFromObject(object: AnyObject, URLResponse: NSHTTPURLResponse) -> Response? { | |
guard let dictionary = object as? [String: AnyObject] else { | |
return nil | |
} | |
guard let user = try? User.decode(dictionary) else { | |
return nil | |
} | |
return user | |
} | |
public init() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment