FirebaseFirestoreSwift Framework Reference

DocumentIDWrappable

public protocol DocumentIDWrappable

A type that can initialize itself from a Firestore DocumentReference, which makes it suitable for use with the @DocumentID property wrapper.

Firestore includes extensions that make String and DocumentReference conform to DocumentIDWrappable.

Note that Firestore ignores fields annotated with @DocumentID when writing so there is no requirement to convert from the wrapped type back to a DocumentReference.

  • Creates a new instance by converting from the given DocumentReference.

    Declaration

    Swift

    static func wrap(_ documentReference: DocumentReference) throws -> Self