TWSList Class Reference

Inherits from NSObject
Declared in TWSList.h

Overview

An ordered list of data within Sync.

  sid

The unique identifier for this list.

@property (readonly, nonnull) NSString *sid

Discussion

The unique identifier for this list.

Declared In

TWSList.h

  uniqueName

The unique name for this list.

@property (readonly, nullable) NSString *uniqueName

Discussion

The unique name for this list.

Declared In

TWSList.h

  dateUpdated

The date when this list was last updated.

@property (readonly, nullable) NSDate *dateUpdated

Discussion

The date when this list was last updated.

Declared In

TWSList.h

– addItemWithData:metadata:completion:

Adds a new item to the list with the provided data.

- (void)addItemWithData:(nonnull TWSData *)data metadata:(nullable TWSListItemMetadata *)objectMetadata completion:(nullable TWSListItemCompletion)completion

Parameters

data

The new data.

objectMetadata

Optional metadata for the added item, currently only ttl.

completion

Completion block that will specify the result of the operation and the newly added item.

Discussion

Adds a new item to the list with the provided data.

Declared In

TWSList.h

– getItemAtIndex:completion:

Request the list item at the specified index.

- (void)getItemAtIndex:(TWSItemIndex)index completion:(nonnull TWSListItemCompletion)completion

Parameters

index

The index of the item to retrieve.

completion

Completion block that will specify the result of the operation and the requested item if it exists.

Discussion

Request the list item at the specified index.

Declared In

TWSList.h

– setItemAtIndex:data:metadata:completion:

Sets the item at the specified index.

- (void)setItemAtIndex:(TWSItemIndex)index data:(nonnull TWSData *)data metadata:(nullable TWSListItemMetadata *)objectMetadata completion:(nullable TWSListItemCompletion)completion

Parameters

index

The index of the existing item to set.

data

The new data.

objectMetadata

Optional metadata for the updated item, currently only ttl.

completion

Completion block that will specify the result of the operation and the modified item.

Discussion

Sets the item at the specified index.

Declared In

TWSList.h

– mutateItemAtIndex:mutator:metadata:completion:

Modify the ListItem’s data in a conflict-friendly way.

- (void)mutateItemAtIndex:(TWSItemIndex)index mutator:(nonnull TWSDataMutator)mutator metadata:(nullable TWSListItemMetadata *)objectMetadata completion:(nullable TWSListItemCompletion)completion

Parameters

index

The index of the existing item to mutate.

mutator

The mutator that you provide to modify the data passed in.

objectMetadata

Optional metadata for the mutated item, currently only ttl.

completion

Completion block that will specify the result of the operation and the modified item.

Discussion

Modify the ListItem’s data in a conflict-friendly way.

Declared In

TWSList.h

– removeItemAtIndex:completion:

Removes the ListItem at the specified index.

- (void)removeItemAtIndex:(TWSItemIndex)index completion:(nullable TWSCompletion)completion

Parameters

index

The index of the item to remove.

completion

Completion block that will specify the result of the operation.

Discussion

Removes the ListItem at the specified index.

Declared In

TWSList.h

– queryItemsWithOptions:completion:

Query the list’s items with the requested parameters. The order of items within the page is not guaranteed.

- (void)queryItemsWithOptions:(nonnull TWSListQueryOptions *)listQueryOptions completion:(nonnull TWSListPaginatorCompletion)completion

Parameters

listQueryOptions

The options for the list query.

completion

Completion block that will specify the result of the operation and a paginator for this page of results.

Discussion

Query the list’s items with the requested parameters. The order of items within the page is not guaranteed.

Declared In

TWSList.h

– setTtl:completion:

Set time to live for list object in seconds.

- (void)setTtl:(TWSDuration)ttl completion:(nullable TWSCompletion)completion

Parameters

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 list object in seconds.

This TTL specifies the minimum time the List 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

TWSList.h

– setTtl:forItemAtIndex:completion:

Set time to live for an item in list.

- (void)setTtl:(TWSDuration)ttl forItemAtIndex:(TWSItemIndex)index completion:(nullable TWSCompletion)completion

Parameters

ttl

Time to live in seconds from now or TWSDurationInfinity to indicate no expiry.

index

Index of item to set ttl for.

completion

Completion block that will specify the result of the operation.

Discussion

Set time to live for an item in list.

TTL specifies the minimum time the Item 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

TWSList.h

– removeListWithCompletion:

Remove the list from the system, deleting it.

- (void)removeListWithCompletion:(nullable TWSCompletion)completion

Parameters

completion

Completion block that will specify the result of the operation.

Discussion

Remove the list from the system, deleting it.

Declared In

TWSList.h