EditionPresenter
public protocol EditionPresenter
Interface for downloading and presenting editions to the user.
-
Use this method to present an edition for reading to the user. It will present a new view controller.
The method is async, and
onFinishedOpening
will be called once the edition is going to be actually presented. The edition must be previously downloaded (seedownloadEdition
) or this method will fail withOpenError.Cause.editionNotDownloaded
. If theedition
is stale for some reason and it is not found, then the method will fail withOpenError.Cause.editionNotFound
.Optionally, you can use
sourceView
andsourceImage
to provide a seamless animation fromsourceImage
to the edition being presented. Typically anUIImageView
showing the cover of the edition.presenterViewController
is the presenter view controller, usually the view controller from where the user opens the edition. -
Same as the method above but you can specify the page the edition will be opened at. 1 represents the cover page.
-
Use this method to download an edition and make it available for presentation.
Download progress is provided through
downloadProgressListener
Returns a
Cancelable
instance, so the download can be cancelled through it. If the edition can’t be found, or if it is already downloaded the method will returnnil
.Declaration
Swift
func downloadEdition( edition: Edition, downloadProgressListener: DownloadProgressListener ) -> Cancelable?