EditionCoverProvider

public protocol EditionCoverProvider

Interface to get the cover for a edition as an image.

  • This method provides an UIImage with the cover of an edition given a size through boundingBoxSize in points. The cover size is guaranteed to fit in boundingBoxSize. EditionDisplayInfo.coverSize can be used if you need to calculate an an exact size to pass in boundingBoxSize.

    The cover is provided through the the completion callback.

    The method returns a Cancelable that can be used to cancel the operation. If the operation is canceled, completion will be called with CoverProviderError.canceled.

    The SDK keeps a cache, so it is safe to call this method in offline mode. If the network fails or can’t be accessed the SDK will use any cached image available, even if it needs to upscale to satisfy the boundingBoxSize.

    Declaration

    Swift

    func coverImageForEdition(
        edition: Edition,
        boundingBoxSize: CGSize,
        completion: @escaping (_ result: Result<UIImage, Error>) -> Void
    ) -> Cancelable