Created
February 5, 2019 08:06
-
-
Save reddavis/3e61147b62002c35bb9c4d6910e94c3c 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
internal extension KeyedDecodingContainer | |
{ | |
internal func decode<T: Decodable>(_ key: KeyedDecodingContainer<K>.Key) throws -> T | |
{ | |
return try self.decode(T.self, forKey: key) | |
} | |
internal func decodeIfPresent<T: Decodable>(_ key: KeyedDecodingContainer<K>.Key) throws -> T? | |
{ | |
return try self.decodeIfPresent(T.self, forKey: key) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment