CarouselImageLoader
public protocol CarouselImageLoader : AnyObject
Protocol used to load an image from url
-
Load image from url
Declaration
Swift
func loadImage(url: URL, completion: ((_ image: UIImage?, _ error: Error?) -> Void)?)
Parameters
url
image url
completion
callback with image on success or error on failure
-
Load image from url
Declaration
Swift
func loadImage( url: URL, cachePolicy: URLRequest.CachePolicy, queue: DispatchQueue, completion: ((UIImage?, Error?) -> Void)? )
Parameters
url
image url
cachePolicy
cache policy for the requested image data
queue
queue to call completion on
completion
callback with image on success or error on failure
-
Cancels image loading for a given url
Declaration
Swift
func cancelImageLoad(from url: URL)