ARTPaginatedResult
Objective-C
@interface ARTPaginatedResult<ItemType> : NSObject
Swift
class ARTPaginatedResult<ItemType> : NSObject, @unchecked Sendable where ItemType : AnyObject
Contains a page of results for message or presence history, stats, or REST presence requests. An ARTPaginatedResult response from a REST API paginated query is also accompanied by metadata that indicates the relative queries available to the ARTPaginatedResult object.
-
Contains the current page of results; for example, an array of
ARTMessageorARTPresenceMessageobjects for a channel history request.Declaration
Objective-C
@property (nonatomic, readonly) NSArray<ItemType> *_Nonnull items;Swift
var items: [ItemType] { get } -
Returns
trueif there are more pages available by calling next and returnsfalseif this page is the last page available.Declaration
Objective-C
@property (nonatomic, readonly) BOOL hasNext;Swift
var hasNext: Bool { get } -
Returns
trueif this page is the last page and returnsfalseif there are more pages available by calling next available.Declaration
Objective-C
@property (nonatomic, readonly) BOOL isLast;Swift
var isLast: Bool { get } -
If you use this initializer, trying to call any of the methods or properties in
ARTPaginatedResultwill throw an exception; you must provide your own implementation in a subclass. This initializer exists purely to allow you to provide a mock implementation of this class in your tests.Declaration
Objective-C
- (nonnull instancetype)init;Swift
init() -
Returns a new
ARTPaginatedResultfor the first page of results.Declaration
Objective-C
- (void)first:(nonnull void (^)(ARTPaginatedResult<ItemType> *_Nullable, ARTErrorInfo *_Nullable))callback;Swift
func first(_ callback: @escaping (ARTPaginatedResult<ItemType>?, ARTErrorInfo?) -> Void)Parameters
callbackA callback for retriving an
ARTPaginatedResultobject with an array ofItemTypeobjects. -
Returns a new
ARTPaginatedResultloaded with the next page of results. If there are no further pages, thennilis returned.Declaration
Objective-C
- (void)next:(nonnull void (^)(ARTPaginatedResult<ItemType> *_Nullable, ARTErrorInfo *_Nullable))callback;Swift
func next(_ callback: @escaping (ARTPaginatedResult<ItemType>?, ARTErrorInfo?) -> Void)Parameters
callbackA callback for retriving an
ARTPaginatedResultobject with an array ofItemTypeobjects.