Created
April 8, 2019 02:54
-
-
Save juliantejera/cbbc13a2de650d94c3a3313d08a235de to your computer and use it in GitHub Desktop.
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
struct Alien: Decodable { | |
private enum CodingKeys: String, CodingKey { | |
case humans | |
} | |
let humans: [Human] | |
init(from decoder: Decoder) throws { | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
humans = try container.decodeArrayWithOptionalElements([Human].self, forKey: .humans) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment