DittoRegister

public class DittoRegister

Represents a CRDT register that can be upserted as part of a document or assigned to a property during an update of a document.

  • Initializes a new register with the provided value that can be used as part of a document’s content.

    Declaration

    Swift

    public init(value: Any?)

Value accessors

  • Returns the register’s value as an Any?.

    Declaration

    Swift

    public var value: Any? { get }
  • Returns the register’s value as a String if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var string: String? { get }
  • Returns the register’s value as a String. If the register’s inner value isn’t a String the return value will be an empty string.

    Declaration

    Swift

    public var stringValue: String { get }
  • Returns the register’s value as a Bool if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var bool: Bool? { get }
  • Returns the register’s value as a Bool. If the register’s inner value isn’t a Bool the return value will be false.

    Declaration

    Swift

    public var boolValue: Bool { get }
  • int

    Returns the register’s value as an Int if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var int: Int? { get }
  • Returns the register’s value as an Int. If the register’s inner value isn’t an Int the return value will be 0.

    Declaration

    Swift

    public var intValue: Int { get }
  • Returns the register’s value as a UInt if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var uint: UInt? { get }
  • Returns the register’s value as a UInt. If the register’s inner value isn’t a UInt the return value will be 0.

    Declaration

    Swift

    public var uintValue: UInt { get }
  • Returns the register’s value as a Float if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var float: Float? { get }
  • Returns the register’s value as a Float. If the register’s inner value isn’t a Float the return value will be 0.

    Declaration

    Swift

    public var floatValue: Float { get }
  • Returns the register’s value as a Double if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var double: Double? { get }
  • Returns the register’s value as a Double. If the register’s inner value isn’t a Double the return value will be 0.

    Declaration

    Swift

    public var doubleValue: Double { get }
  • Returns the register’s value as an Array<Any?> if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var array: [Any?]? { get }
  • Returns the register’s value as an Array<Any?>. If the register’s inner value isn’t an Array<Any?> the return value will be an empty array.

    Declaration

    Swift

    public var arrayValue: [Any?] { get }
  • Returns the register’s value as a [String: Any?] if possible, otherwise the return value will be nil.

    Declaration

    Swift

    public var dictionary: [String : Any?]? { get }
  • Returns the register’s value as a [String: Any?]. If the register’s inner value isn’t a [String: Any?] the return value will be an empty dictionary.

    Declaration

    Swift

    public var dictionaryValue: [String : Any?] { get }