FirebaseFirestore Framework Reference

Blob

class Blob : NSObject, NSCopying, @unchecked Sendable

Represents a binary blob or BSON binary data in Firestore documents.

  • An 8-bit unsigned integer denoting the subtype of the data. Returns 0 for standard Blobs.

    Declaration

    Swift

    var subtype: UInt8 { get }
  • The binary data.

    Declaration

    Swift

    var bytes: Data { get }
  • Creates a standard Blob with the given data.

    Declaration

    Swift

    convenience init(bytes: Data)

    Parameters

    bytes

    The binary data.

  • Creates a BSON Binary type Blob with subtype 0.

    Declaration

    Swift

    convenience init(bsonBinary bytes: Data)

    Parameters

    bytes

    The binary data.

  • Creates a BSON Binary type Blob with the specified subtype.

    Declaration

    Swift

    convenience init(bsonBinary bytes: Data, subtype: UInt8)

    Parameters

    bytes

    The binary data.

    subtype

    An 8-bit unsigned integer denoting the subtype of the data (must be [0, 255]).

  • Returns true if the given object is equal to this, and false otherwise.

    Declaration

    Swift

    func isEqual(_ object: Any?) -> Bool
  • Compares this Blob to another Blob.

    Declaration

    Swift

    func compare(_ other: Blob) -> ComparisonResult