DittoMutableCounter

public class DittoMutableCounter : DittoCounter

Represents a mutable CRDT counter that can be incremented by a specific amount while updating a document.

This class can’t be instantiated directly, it’s returned automatically for any counter property within an update block.

See also the counter properties of DittoDocumentPath and DittoMutableDocumentPath.

  • Increments the counter by amount, which can be any valid 64 bit float. Only valid within the closure of DittoCollection‘s update method, otherwise an exception is thrown.

    Declaration

    Swift

    public func increment(by amount: Double)