EditionProvider
public protocol EditionProvider
Protocol to get the the editions available since the latest feed update.
See also
updateFeed(completion:)
-
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 filtersproductTags
,startDate
,endDate
and apageSize
for the paginator. WhenpageSize
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 theid
value. This method is normally used to getEdition
objects after usingDownloadedEditionsProvider
.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]]
, wherecount
is the count ofEdition
for 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
func editionCounts( productTags: [String]?, callback: @escaping (EditionCounts) -> Void )
-
edition(id:
Extension method, asynchronous) Retrieves an
Edition
matching theid
value. This method is normally used to getEdition
objects after usingDownloadedEditionsProvider
.Declaration
Swift
func edition(id: UUID) async -> Edition?
-
editionCounts(productTags:
Extension method, asynchronous) Returns a map of the form
[year : [month : count]]
, wherecount
is the count ofEdition
for 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
func editionCounts( productTags: [String]? ) async -> EditionCounts