DittoMutableRGA
public class DittoMutableRGA
Represents a mutable CRDT Replicated Growable Array (RGA) that can be updated as part of updating a document.
This class can’t be instantiated directly. It’s returned automatically for any RGA property within an update block.
See also the rga property of DittoMutableDocumentPath.
-
The value that is stored in the register.
Declaration
Swift
@available(*, deprecated, message: "DittoRGA usage should be replaced. Use arrays inside DittoRegisters instead") public var value: [Any?] { get }
-
Set a value at the specified index.
Declaration
Swift
@available(*, deprecated, message: "DittoRGA usage should be replaced. Use arrays inside DittoRegisters instead") public func set(value: Any?, atIndex index: Int)Parameters
valueThe value to set at the specified index.
indexThe index at which to set the provided value.
-
Remove a value at the specified index.
Declaration
Swift
@available(*, deprecated, message: "DittoRGA usage should be replaced. Use arrays inside DittoRegisters instead") public func remove(atIndex index: Int)Parameters
indexThe index of the element to remove.
-
Push a value on to the end of the RGA.
Declaration
Swift
@available(*, deprecated, message: "DittoRGA usage should be replaced. Use arrays inside DittoRegisters instead") public func push(_ value: Any?)Parameters
valueThe value to push on to the RGA.
-
Pop a value off the end of the RGA.
Declaration
Swift
@available(*, deprecated, message: "DittoRGA usage should be replaced. Use arrays inside DittoRegisters instead") public func pop() -> Any?Return Value
The value popped off from the end of the RGA.
-
Inserts a value into the RGA at the index specified.
Declaration
Swift
@available(*, deprecated, message: "DittoRGA usage should be replaced. Use arrays inside DittoRegisters instead") public func insert(_ value: Any?, atIndex index: Int)Parameters
valueThe value to insert into the RGA.
indexThe index at which to insert the provided value.
DittoMutableRGA Class Reference