Editions
@MainActor
public class Editions
Main class of Richie’s Editions SDK.
-
Use
editionProductsProvider
to access to edition products, seeEditionProductsProvider
.Declaration
Swift
@MainActor public private(set) var editionProductsProvider: EditionProductsProvider? { get }
-
Use
editionProvider
to access to editions, seeEditionProvider
.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, seeDownloadedEditionsProvider
.Declaration
Swift
@MainActor public private(set) var downloadedEditionsProvider: DownloadedEditionsProvider? { get }
-
Use
editionPresenter
to download and present editions, seeEditionPresenter
.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 }
-
Undocumented
Declaration
Swift
@MainActor public init( bundleId: String, distributedTracingIDSource: DistributedTracingIDSource? = nil, tokenProvider: TokenProvider, analyticsListener: AnalyticsListener?, ads: RichieAdsController? = nil )
-
Initializes Editions.
Call this method, and wait for a successful
completion
, before using any of the features, otherwise the SDK will be in a undetermined state. Ifcompletion
ends withsuccess
==false
you can keep callinginitialize
until it finishes successfully.Once
initialize
completes succesfuly you can start querying cached editions or products usingEditionProvider
EditionProductsProvider
, but you need to callupdateFeed(completion:)
if you want to receive new content. The main use case for querying cached editions before updating the feed is to show content to the user as soon as posibble while the feed is being updated.See
initialize()
for an async version of this method.Declaration
Swift
@MainActor public func initialize(completion: @escaping (_ success: Bool) -> Void)
-
initialize()
AsynchronousSee
initialize(completion:)
for details.In case of failure, throws
EditionsInitializationError
.Declaration
Swift
@MainActor public func initialize() async throws
-
Updates the editions available through the SDK.
Using
EditionProvider
aftercompletion
finishes with success warranties 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 warranties 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