Created
October 16, 2017 14:07
-
-
Save dejanskledar/2362e61cff7b4b58d458e9560f65dffc 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
extension Sword { | |
init(from decoder: Decoder) throws { | |
let values = try decoder.container(keyedBy: CodingKeys.self) | |
name = try values.decode(String.self, forKey: .name) | |
size = try values.decode(Int.self, forKey: .size) | |
isValyrianSteel = try values.decode(Bool.self, forKey: .isValyrianSteel) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment