Editions
@MainActor
public class Editions
Main class of Richie’s Editions SDK.
To construct an Editions
instance, use makeEditions(analyticsListener:tokenProvider:)
.
-
Use
editionProductsProvider
to access to edition products.Declaration
Swift
@MainActor public private(set) var editionProductsProvider: EditionProductsProvider? { get }
-
Use
editionProvider
to access to editions.Declaration
Swift
@MainActor public private(set) var editionProvider: EditionProvider? { get }
-
Use
editionCoverProvider
to get anUIImage
or aData
for an edition cover.The
EditionCoverProvider
protocol conformance can provide anUIImage
, and theEditionCoverDataProvider
conformance provides the image files asData
.Declaration
Swift
@MainActor public private(set) var editionCoverProvider: (EditionCoverProvider & EditionCoverDataProvider)? { get }
-
Use
downloadedEditionsProvider
to get a list of downloaded editions.Declaration
Swift
@MainActor public private(set) var downloadedEditionsProvider: DownloadedEditionsProvider? { get }
-
Use
editionPresenter
to download and present editions.Declaration
Swift
@MainActor public private(set) var editionPresenter: EditionPresenter? { get }
-
Use
downloadedEditionsManager
to delete downloaded editions, seeDownloadedEditionsManager
.Declaration
Swift
@MainActor public private(set) var downloadedEditionsManager: DownloadedEditionsManager? { get }
-
Use
editionsDiskUsageProvider
to get downloaded editions disk usage, seeEditionsDiskUsageProvider
.Declaration
Swift
@MainActor public private(set) var editionsDiskUsageProvider: EditionsDiskUsageProvider? { get }
-
Updates the editions available through the SDK.
Using
EditionProvider
aftercompletion
finishes with success guarantees that it will contain the latest editions available from the feed.See also
updateFeed()
is the async version of this method.Declaration
Swift
@MainActor public func updateFeed(completion: @escaping (_ success: Bool) -> Void)
-
updateFeed()
AsynchronousUpdates the editions available through the SDK.
Using
EditionProvider
aftercompletion
finishes with success guarantees that it will contain the latest editions available from the feed.This method is the async version of
updateFeed(completion:)
.Declaration
Swift
@MainActor public func updateFeed() async -> Bool
-
Close any edition readers that are open at the moment.
Declaration
Swift
@MainActor public func closeEditionReader()