Last active
August 29, 2015 14:23
-
-
Save AlexanderNey/c0a54d57c8f7dc06372b to your computer and use it in GitHub Desktop.
ARTICLE Function Composing Swift 2.0 - 2
This file contains 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
enum JSONParseError : ErrorType { | |
case InvalideJSON | |
case UnexpectedCharacter(line: Int, column: Int) | |
} | |
enum ServerResponseError : ErrorType { | |
case InvalidResponse | |
case ErrorResponse(message: String) | |
} | |
enum UnmarshalResponseError : ErrorType { | |
case InvalidResponse | |
case ErrorResponse | |
} | |
func parseJSONFromNSData(data: NSData) throws -> JSON { ... } | |
func validateJSONResponse(json: JSON) throws -> JSON { ... } | |
func unmarshalJSON<T : Unmarshallable>(json: JSON, type: T.Type) throws -> T { ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment