CursorPagingCollection

public protocol CursorPagingCollection : PagingCollection where Self.Element : CursorPageable

A collection that supports cursor-based pagination.

The CursorPagingCollection protocol is tightly linked with the CursorProtocol and CursorPageable protocols. As opposed to offset-based paging collections, cursor-based paging collections depend on a set of cursors to identify the first and last items in a given page, providing reference points from which to page through a larger list of results, typically sorted in chronological order. The type of cursor used to identify the items depends on the type of items returned in the page. Therefore, types that conform to this protocol must also conform its elements to CursorPageable and provide an associated type that conforms to the CursorProtocol, where its cursor type matches that of the collection’s Element.

  • A type that contains a set of cursors used to identify items in the collection.

    The associated cursor type must match that of the collection’s Element.

    Declaration

    Swift

    associatedtype Cursors : CursorProtocol where Self.Cursors.CursorType == Self.Element.CursorType
  • The cursors used to identify the first and last items in the page.

    Declaration

    Swift

    var cursors: Cursors { get }