Created
April 8, 2019 02:36
-
-
Save juliantejera/02e995a35c68e0ca841e73c32a1fd618 to your computer and use it in GitHub Desktop.
Decodable Container to parse types.
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 DecodableContainer<T>: Decodable where T: Decodable { | |
let value: T? | |
init(from decoder: Decoder) throws { | |
value = try? T.init(from: decoder) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment