EditionProvider
@MainActor
public protocol EditionProvider
Protocol to get the the editions available since the latest feed update.
See also
updateFeed(completion:)
-
Returns a
Paginatorobject that can be used to iterate over the requested editions. Editions are sorted by date with newer editions first. You can specify filtersproductTags,startDate,endDateand apageSizefor the paginator. WhenpageSizeis 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
@MainActor func editions( productTags: [String]?, startDate: Date?, endDate: Date?, pageSize: Int? ) -> any Paginator -
Retrieves an
Editionmatching theidvalue. This method is normally used to getEditionobjects after usingDownloadedEditionsProvider.See also
edition(id:)for an async version.Declaration
Swift
@MainActor func edition(id: UUID, callback: @escaping (Edition?) -> Void) -
Searches editions matching the title and product tag.
Declaration
Swift
@MainActor func editions(title: String, productTag: String, pageSize: Int?) -> PaginatorParameters
titleTitle of the edition to find.
productTagProduct tag of the edition to find. The product tag format is “organization/productTag” or “productTag” if the productTag matches the organization.
pageSizeUpper limit for paginator page size. Can be nil for unlimited.
Return Value
A
Paginatorfor 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]], wherecountis the count ofEditionfor that month. Format for years and months is numeric (e.g. “2023”, “01”). You can narrow the results down withproductTags. An empty map is returned on errors.See also
editionCounts(productTags:)for an async version.Declaration
Swift
@MainActor func editionCounts( productTags: [String]?, callback: @escaping (EditionCounts) -> Void ) -
edition(id:Extension method, asynchronous) Retrieves an
Editionmatching theidvalue. This method is normally used to getEditionobjects after usingDownloadedEditionsProvider.Declaration
Swift
@MainActor func edition(id: UUID) async -> Edition? -
editionCounts(productTags:Extension method, asynchronous) Returns a map of the form
[year : [month : count]], wherecountis the count ofEditionfor that month. Format for years and months is numeric (e.g. “2023”, “01”). You can narrow the results down withproductTags. An empty map is returned on errors.Declaration
Swift
@MainActor func editionCounts( productTags: [String]? ) async -> EditionCounts