devsite/tools/jazzy/templates

FirebaseFirestore Framework Reference

SnapshotListenOptions

class SnapshotListenOptions : NSObject, @unchecked Sendable

Options to configure the behavior of Firestore.addSnapshotListenerWithOptions(). Instances of this class control settings like whether metadata-only changes trigger events and the preferred data source.

  • The source the snapshot listener retrieves data from.

    Declaration

    Swift

    var source: ListenSource { get }
  • Indicates whether metadata-only changes should trigger snapshot events.

    Declaration

    Swift

    var includeMetadataChanges: Bool { get }
  • Creates and returns a new SnapshotListenOptions object with all properties initialized to their default values.

    Declaration

    Swift

    init()

    Return Value

    The created SnapshotListenOptions object.

  • Creates and returns a new SnapshotListenOptions object with all properties of the current SnapshotListenOptions object plus the new property specifying whether metadata-only changes should trigger snapshot events

    Declaration

    Swift

    func withIncludeMetadataChanges(_ includeMetadataChanges: Bool) -> SnapshotListenOptions

    Return Value

    The created SnapshotListenOptions object.

  • Creates and returns a new SnapshotListenOptions object with all properties of the current SnapshotListenOptions object plus the new property specifying the source that the snapshot listener listens to.

    Declaration

    Swift

    func withSource(_ source: ListenSource) -> SnapshotListenOptions

    Return Value

    The created SnapshotListenOptions object.