ImageProvider

@objc(PESDKImageProvider) open class ImageProvider: NSObject

This class is out to provide an easy service to get images, either from a local or remote source.

  • When the ImageProvider is used by a component that wants to show a progress view this delegate is used to inform the component that the progress view should be shown or hidden.

    Declaration

    Swift

    open weak var progressViewDisplayer: ProgressViewDisplayer?
  • Get a collection of images.

    Declaration

    Swift

    open func getImages(from urls: [URL], completion: (([URL: UIImage]?, [Error]?) -> Void))

    Parameters

    urls

    URLs of the images.

    completion

    A block that passes the images on sucess, or the errors otherwise.

  • Get a single image.

    Declaration

    Swift

    open func getImage(from imageURL: URL, completion: @escaping ((UIImage?, Error?) -> Void))

    Parameters

    imageURL

    The URL of the image.

    completion

    A completion block that passes the image on succsess or the error on failure.