FirebaseDatabaseSwift Framework Reference

DataSnapshot

public extension DataSnapshot
  • Retrieves the value of a snapshot and converts it to an instance of caller-specified type. Throws DecodingError.valueNotFound if the document does not exist and T is not an Optional.

    See Database.Decoder for more details about the decoding process.

    Declaration

    Swift

    func data<T: Decodable>(as type: T.Type,
                            decoder: Database.Decoder =
                              Database.Decoder()) throws -> T