Last active
April 10, 2018 19:00
-
-
Save Kdan/9d78490d35d29c480dd41eca90b28531 to your computer and use it in GitHub Desktop.
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
class Person: Codable { | |
let name: String | |
/// Retrieve the pets of the Person. | |
func getPets(completion: ([Pet]) -> Void) throws { | |
// Networking request omitted for simplicity. | |
let data = responseData | |
completion(try JSONDecoder().decode([Pet].self, from: data)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment