DITRegister

@interface DITRegister : NSObject

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

  • The value in the register.

    Declaration

    Objective-C

    @property (nonatomic, readonly) id _Nonnull value;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Initializes a new register with the provided value that can be used as part of a document’s content.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithValue:(nonnull id)value;
  • Returns YES if passed in register has the same value, otherwise returns NO.

    Declaration

    Objective-C

    - (BOOL)isEqualToRegister:(nonnull DITRegister *)ditRegister;
  • Returns the register’s value as an NSString if possible, otherwise the return value will be nil.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *string;
  • Returns the register’s value as an NSString. If the key was invalid the return value will be an empty string.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull stringValue;
  • Returns the register’s value as a BOOL. If the key was invalid the return value will be false.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL booleanValue;
  • Returns the register’s value as an NSInteger if possible, otherwise the return value will be 0.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger integerValue;
  • Returns the register’s value as an NSNumber if possible, otherwise the return value will be nil.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSNumber *number;
  • Returns the register’s value as an NSNumber. If the key was invalid the return value will be an NSNumber with a value of 0.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull numberValue;
  • Returns the register’s value as an NSArray if possible, otherwise the return value will be nil.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray *array;
  • Returns the register’s value as an NSArray. If the key was invalid the return value will be an empty array.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray *_Nonnull arrayValue;
  • Returns the register’s value as an NSDictionary if possible, otherwise the return value will be nil.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSDictionary<NSString *, id> *dictionary;
  • Returns the register’s value as an NSDictionary. If the key was invalid the return value will be an empty dictionary.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSDictionary<NSString *, id> *_Nonnull dictionaryValue;