Last active
January 13, 2019 11:19
-
-
Save mwaterfall/7090c1282cd7079e9da14720ee4df8a8 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 Material { | |
init(from decoder: Decoder) throws { | |
let container = try decoder.singleValueContainer() | |
let rawMaterial = try container.decode(String.self) | |
self = Material(rawValue: rawMaterial) ?? .other | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment