Decodable
extension Decodable
Extensions to simplify conversion between Decodable types and dictionaries.
-
Creates an instance of the conforming type from a dictionary with string keys and
Sendablevalues.This convenience initializer converts the dictionary to JSON data and then decodes it using the type’s
Decodableimplementation.Declaration
Swift
public init?(dictionary: [String : any Sendable])Parameters
dictionaryA dictionary with string keys and
Sendablevalues to decode fromReturn Value
An instance of the conforming type, or
nilif decoding fails
View on GitHub