CKNetworkImageDownloading Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | CKNetworkImageDownloading.h |
– downloadImageWithURL:caller:callbackQueue:downloadProgressBlock:completion:
required method
Downloads an image with the given URL.
- (id)downloadImageWithURL:(NSURL *)URL caller:(id)caller callbackQueue:(dispatch_queue_t)callbackQueue downloadProgressBlock:(void ( ^ ) ( CGFloat progress ))downloadProgressBlock completion:(void ( ^ ) ( CGImageRef image , NSError *error ))completion
Parameters
URL |
The URL of the image to download. |
---|---|
caller |
The object that initiated the request. |
callbackQueue |
The queue to call |
downloadProgressBlock |
The block to be invoked when the download of |
completion |
The block to be invoked when the download has completed, or has failed.
Receives:
- image that was downloaded, if the image could be successfully downloaded; nil otherwise.
- error describing why the download of |
Return Value
An opaque identifier to be used in canceling the download, via cancelImageDownload:
. You must retain the identifier if you wish to use it later.
Discussion
If URL
is nil, completion
will be invoked immediately with a nil image and an error describing why the download failed.
Declared In
CKNetworkImageDownloading.h
– cancelImageDownload:
required method
Cancels an image download.
- (void)cancelImageDownload:(id)download
Parameters
download |
The opaque download identifier object returned from |
---|
Discussion
This method has no effect if download
is nil.
Declared In
CKNetworkImageDownloading.h