Skip to content

Instantly share code, notes, and snippets.

@juliantejera
Created April 8, 2019 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliantejera/02e995a35c68e0ca841e73c32a1fd618 to your computer and use it in GitHub Desktop.
Save juliantejera/02e995a35c68e0ca841e73c32a1fd618 to your computer and use it in GitHub Desktop.
Decodable Container to parse types.
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