TWSDocument Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | TWSDocument.h |
sid
The unique identifier for this document.
@property (readonly, nonnull) NSString *sidDiscussion
The unique identifier for this document.
Declared In
TWSDocument.h
uniqueName
The unique name for this document.
@property (readonly, nullable) NSString *uniqueNameDiscussion
The unique name for this document.
Declared In
TWSDocument.h
dateUpdated
The date when this document was last updated.
@property (readonly, nullable) NSDate *dateUpdatedDiscussion
The date when this document was last updated.
Declared In
TWSDocument.h
data
Obtain a snapshot of the document’s current data.
@property (readonly, nonnull) TWSData *dataDiscussion
Obtain a snapshot of the document’s current data.
Declared In
TWSDocument.h
– setData:metadata:completion:
Update the value of the document’s data.
- (void)setData:(nonnull TWSData *)data metadata:(nullable TWSDocumentMetadata *)objectMetadata completion:(nullable TWSDataCompletion)completionParameters
data |
The new data. |
|---|---|
objectMetadata |
Optional metadata for the updated document, currently only ttl. |
completion |
Completion block that will specify the result of the operation and the updated value of the data. |
Discussion
Update the value of the document’s data.
Declared In
TWSDocument.h
– mutateDataWith:metadata:completion:
Modify the Document’s data in a conflict-friendly way.
- (void)mutateDataWith:(nonnull TWSDataMutator)mutator metadata:(nullable TWSDocumentMetadata *)objectMetadata completion:(nullable TWSDataCompletion)completionParameters
mutator |
The mutator that you provide to modify the data passed in. |
|---|---|
objectMetadata |
Optional metadata for the updated document, currently only ttl. |
completion |
Completion block that will specify the result of the operation and the updated value of the data. |
Discussion
Modify the Document’s data in a conflict-friendly way.
Declared In
TWSDocument.h
– setTtl:completion:
Set time to live for document object in seconds.
- (void)setTtl:(TWSDuration)ttl completion:(nullable TWSCompletion)completionParameters
ttl |
Time to live in seconds from now or TWSDurationInfinity to indicate no expiry. |
|---|---|
completion |
Completion block that will specify the result of the operation. |
Discussion
Set time to live for document object in seconds.
This TTL specifies the minimum time the Document will live, sometime soon after this time the object will be deleted.
If time to live is not specified, object lives infinitely long.
TTL could be used in order to auto-recycle old unused objects, but it is not recommended to build some app logic like timers using ttl.
Declared In
TWSDocument.h
– removeDocumentWithCompletion:
Remove the document from the system, deleting it.
- (void)removeDocumentWithCompletion:(nullable TWSCompletion)completionParameters
completion |
Completion block that will specify the result of the operation. |
|---|
Discussion
Remove the document from the system, deleting it.
Declared In
TWSDocument.h