EditionCoverDataProvider

public protocol EditionCoverDataProvider

Interface to get the cover for a edition as data.

  • This method provides a Data value with the image file data for the cover of an edition. The cover is provided through the the completion callback. targetSize is used for URL creation if the image is not locally available, but this method makes no guarantees about the size of the image represented by the returned data.

    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.

    Declaration

    Swift

    func coverDataForEdition(
        edition: Edition,
        targetSize: CGSize,
        completion: @escaping (_ result: Result<Data, Error>) -> Void
    ) -> Cancelable