Decoder
struct Decoder
Undocumented
-
Undocumented
Declaration
Swift
public init()
-
Returns an instance of specified type from a Firestore document.
If exists in
container
, Firestore specific types are recognized, and passed through toDecodable
implementations. This means types below incontainer
are directly supported:- GeoPoint
- Timestamp
DocumentReference
A type to decode a document to.
container: A Map keyed of String representing a Firestore document.
document: A reference to the Firestore Document that is being decoded.
Declaration
Swift
public func decode<T: Decodable>(_: T.Type, from container: Any, in document: DocumentReference? = nil) throws -> T
Parameters
container
A Map keyed of String representing a Firestore document.
document
A reference to the Firestore Document that is being decoded.
Return Value
An instance of specified type by the first parameter.