Created
January 29, 2019 11:21
-
-
Save charlieInDen/28283dd8c2f6c83b4eeae6d9a968ce2e to your computer and use it in GitHub Desktop.
API Request Protocol - Code restructuring so that unit test cases can be written for code
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
protocol APIRequest { | |
associatedtype RequestDataType | |
associatedtype ResponseDataType | |
func makeRequest(from data: RequestDataType) throws -> URLRequest | |
func parseResponse(data: Data) throws -> ResponseDataType | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment