Created
May 26, 2018 17:48
-
-
Save gokselkoksal/8bb3af6405e354a5958956d6bb78f2c5 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 KeyedDecodingContainer { | |
func decodeIfPresent<T: Decodable>(key: K) throws -> T? { | |
return try decodeIfPresent(T.self, forKey: key) | |
} | |
func decode<T: Decodable>(key: K) throws -> T { | |
return try decode(T.self, forKey: key) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enables:
Instead of: