EditionProvider

public protocol EditionProvider

Protocol to get the the editions available since the latest feed update.

  • Returns a Paginator object that can be used to iterate over the requested editions. Editions are sorted by date with newer editions first. You can specify filters productTags, startDate, endDate and a pageSize for the paginator. When pageSize is nil, the method will return a Paginator with ALL the Editions matching the filters in a single Page.

    The product tag format is “organization/productTag” or “productTag” if the productTag matches the organization.

    Declaration

    Swift

    func editions(
        productTags: [String]?,
        startDate: Date?,
        endDate: Date?,
        pageSize: Int?
    ) -> any Paginator
  • Retrieves an Edition matching the id value. This method is normally used to get Edition objects after using DownloadedEditionsProvider.

    See also

    edition(id:) for an async version.

    Declaration

    Swift

    func edition(id: UUID, callback: @escaping (Edition?) -> Void)
  • Searches editions matching the title and product tag.

    Declaration

    Swift

    func editions(title: String, productTag: String, pageSize: Int?) -> Paginator

    Parameters

    title

    Title of the edition to find.

    productTag

    Product tag of the edition to find. The product tag format is “organization/productTag” or “productTag” if the productTag matches the organization.

    pageSize

    Upper limit for paginator page size. Can be nil for unlimited.

    Return Value

    A Paginator for the matched editions. The editions are sorted by date in descending order, i.e. latest first.

  • Returns a map of the form [year : [month : count]], where count is the count of Edition for that month. Format for years and months is numeric (e.g. “2023”, “01”). You can narrow the results down with productTags. An empty map is returned on errors.

    See also

    editionCounts(productTags:) for an async version.

    Declaration

    Swift

    func editionCounts(
        productTags: [String]?,
        callback: @escaping (EditionCounts) -> Void
    )
  • edition(id:) Extension method, asynchronous

    Retrieves an Edition matching the id value. This method is normally used to get Edition objects after using DownloadedEditionsProvider.

    Declaration

    Swift

    func edition(id: UUID) async -> Edition?
  • editionCounts(productTags:) Extension method, asynchronous

    Returns a map of the form [year : [month : count]], where count is the count of Edition for that month. Format for years and months is numeric (e.g. “2023”, “01”). You can narrow the results down with productTags. An empty map is returned on errors.

    Declaration

    Swift

    func editionCounts(
        productTags: [String]?
    ) async -> EditionCounts