//apple_ref/occ/cl/PINRemoteImageManager

PINRemoteImageManager is the main workhorse of PINRemoteImage. It is unnecessary to access directly if you simply wish to download images and have them rendered in a UIImageView, UIButton or FLAnimatedImageView.

PINRemoteImageManager.h

//apple_ref/occ/clm/PINRemoteImageManager/sharedImageManager

Get the shared instance of PINRemoteImageManager

PINRemoteImageManager.h + (instancetype)sharedImageManager

Shared instance of PINRemoteImageManager

//api/name/sharedImageManager

//apple_ref/occ/instm/PINRemoteImageManager/defaultImageCache

The result of this method is assigned to self.cache in init. If you wish to provide a customized cache to the manager you can subclass PINRemoteImageManager and return a custom PINCache from this method.

PINRemoteImageManager.h - (PINCache *)defaultImageCache

An instance of a PINCache object.

//api/name/defaultImageCache

//apple_ref/occ/instm/PINRemoteImageManager/setHighQualityBPSThreshold:completion:

Set the minimum BPS to download the highest quality image in a set.

PINRemoteImageManager.h //apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURLs:options:progress:completion: - (void)setHighQualityBPSThreshold:(float)highQualityBPSThreshold completion:(dispatch_block_t)completion `highQualityBPSThreshold

bytes per second minimum. Defaults to 500000.

` `completion

Completion to be called once highQualityBPSThreshold has been set.

` //api/name/setHighQualityBPSThreshold:completion:

//apple_ref/occ/instm/PINRemoteImageManager/setLowQualityBPSThreshold:completion:

Set the maximum BPS to download the lowest quality image in a set.

PINRemoteImageManager.h //apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURLs:options:progress:completion: - (void)setLowQualityBPSThreshold:(float)lowQualityBPSThreshold completion:(dispatch_block_t)completion `lowQualityBPSThreshold

bytes per second maximum. Defaults to 50000.

` `completion

Completion to be called once lowQualityBPSThreshold has been set.

` //api/name/setLowQualityBPSThreshold:completion:

//apple_ref/occ/instm/PINRemoteImageManager/setShouldUpgradeLowQualityImages:completion:

Set whether high quality images should be downloaded when a low quality image is cached if network connectivity has improved.

PINRemoteImageManager.h //apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURLs:options:progress:completion: - (void)setShouldUpgradeLowQualityImages:(BOOL)shouldUpgradeLowQualityImages completion:(dispatch_block_t)completion `shouldUpgradeLowQualityImages

if YES, low quality images will be 'upgraded'.

` `completion

Completion to be called once shouldUpgradeLowQualityImages has been set.

` //api/name/setShouldUpgradeLowQualityImages:completion:

//apple_ref/occ/instm/PINRemoteImageManager/setMaxNumberOfConcurrentOperations:completion:

Set the maximum number of concurrent operations (decompressing images, creating gifs, etc).

PINRemoteImageManager.h - (void)setMaxNumberOfConcurrentOperations:(NSInteger)maxNumberOfConcurrentOperations completion:(dispatch_block_t)completion `maxNumberOfConcurrentOperations

The maximum number of concurrent operations. Defaults to NSOperationQueueDefaultMaxConcurrentOperationCount.

` `completion

Completion to be called once maxNumberOfConcurrentOperations is set.

` //api/name/setMaxNumberOfConcurrentOperations:completion:

//apple_ref/occ/instm/PINRemoteImageManager/setMaxNumberOfConcurrentDownloads:completion:

Set the maximum number of concurrent downloads.

PINRemoteImageManager.h - (void)setMaxNumberOfConcurrentDownloads:(NSInteger)maxNumberOfConcurrentDownloads completion:(dispatch_block_t)completion `maxNumberOfConcurrentDownloads

The maximum number of concurrent downloads. Defaults to 10.

` `completion

Completion to be called once maxNumberOfConcurrentDownloads is set.

` //api/name/setMaxNumberOfConcurrentDownloads:completion:

//apple_ref/occ/instm/PINRemoteImageManager/setEstimatedRemainingTimeThresholdForProgressiveDownloads:completion:

Set the estimated time remaining to download threshold at which to generate progressive images. Progressive images previews will only be generated if the estimated remaining time on a download is greater than estimatedTimeRemainingThreshold. If estimatedTimeRemainingThreshold is less than zero, this check is skipped.

PINRemoteImageManager.h - (void)setEstimatedRemainingTimeThresholdForProgressiveDownloads:(NSTimeInterval)estimatedRemainingTimeThreshold completion:(dispatch_block_t)completion `estimatedRemainingTimeThreshold

The estimated remaining time threshold used to decide to skip progressive rendering. Defaults to 0.1.

` `completion

Completion to be called once estimatedTimeRemainingTimeThreshold is set.

` //api/name/setEstimatedRemainingTimeThresholdForProgressiveDownloads:completion:

//apple_ref/occ/instm/PINRemoteImageManager/setProgressThresholds:completion:

Sets the progress at which progressive images are generated. By default this is @[@0.00, @0.35, @0.65] which generates at most, 3 progressive images. The first progressive image will only be generated when at least one scan has been completed (so you never see half an image).

PINRemoteImageManager.h - (void)setProgressThresholds:(NSArray *)progressThresholds completion:(dispatch_block_t)completion `progressThresholds

an array of progress thresholds at which to generate progressive images. progress thresholds should range from 0.00 - 1.00. Defaults to @[@0.00, @0.35, @0.65]

` `completion

Completion to be called once progressThresholds is set.

` //api/name/setProgressThresholds:completion:

//apple_ref/occ/instm/PINRemoteImageManager/prefetchImageWithURL:

Prefetch an image at the given URL.

PINRemoteImageManager.h - (void)prefetchImageWithURL:(NSURL *)url `url

NSURL where the image to prefetch resides.

` //api/name/prefetchImageWithURL:

//apple_ref/occ/instm/PINRemoteImageManager/prefetchImageWithURL:options:

Prefetch an image at the given URL with given options.

PINRemoteImageManager.h - (void)prefetchImageWithURL:(NSURL *)url options:(PINRemoteImageManagerDownloadOptions)options `url

NSURL where the image to prefetch resides.

` `options

PINRemoteImageManagerDownloadOptions options with which to pefetch the image.

` //api/name/prefetchImageWithURL:options:

//apple_ref/occ/instm/PINRemoteImageManager/prefetchImagesWithURLs:

Prefetch images at the given URLs.

PINRemoteImageManager.h - (void)prefetchImagesWithURLs:(NSArray *)urls `urls

An array of NSURLs where the images to prefetch reside.

` //api/name/prefetchImagesWithURLs:

//apple_ref/occ/instm/PINRemoteImageManager/prefetchImagesWithURLs:options:

Prefetch images at the given URLs with given options.

PINRemoteImageManager.h - (void)prefetchImagesWithURLs:(NSArray *)urls options:(PINRemoteImageManagerDownloadOptions)options `urls

An array of NSURLs where the images to prefetch reside.

` `options

PINRemoteImageManagerDownloadOptions options with which to pefetch the image.

` //api/name/prefetchImagesWithURLs:options:

//apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURL:completion:

Download or retrieve from cache the image found at the url. All completions are called on an arbitrary callback queue unless called on the main thread and the result is in the memory cache (this is an optimization to allow synchronous results for the UI when an object is cached in memory).

PINRemoteImageManager.h - (NSUUID *)downloadImageWithURL:(NSURL *)url completion:(PINRemoteImageManagerImageCompletion)completion `url

NSURL where the image to download resides.

` `completion

PINRemoteImageManagerImageCompletion block to call when image has been fetched from the cache or downloaded.

`

An NSUUID which uniquely identifies this request. To be used for canceling requests and verifying that the callback is for the request you expect (see categories for example).

//api/name/downloadImageWithURL:completion:

//apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURL:options:completion:

Download or retrieve from cache the image found at the url. All completions are called on an arbitrary callback queue unless called on the main thread and the result is in the memory cache (this is an optimization to allow synchronous results for the UI when an object is cached in memory).

PINRemoteImageManager.h - (NSUUID *)downloadImageWithURL:(NSURL *)url options:(PINRemoteImageManagerDownloadOptions)options completion:(PINRemoteImageManagerImageCompletion)completion `url

NSURL where the image to download resides.

` `options

PINRemoteImageManagerDownloadOptions options with which to fetch the image.

` `completion

PINRemoteImageManagerImageCompletion block to call when image has been fetched from the cache or downloaded.

`

An NSUUID which uniquely identifies this request. To be used for canceling requests and verifying that the callback is for the request you expect (see categories for example).

//api/name/downloadImageWithURL:options:completion:

//apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURL:options:progress:completion:

Download or retrieve from cache the image found at the url. All completions are called on an arbitrary callback queue unless called on the main thread and the result is in the memory cache (this is an optimization to allow synchronous results for the UI when an object is cached in memory).

PINRemoteImageManager.h - (NSUUID *)downloadImageWithURL:(NSURL *)url options:(PINRemoteImageManagerDownloadOptions)options progress:(PINRemoteImageManagerImageCompletion)progress completion:(PINRemoteImageManagerImageCompletion)completion `url

NSURL where the image to download resides.

` `options

PINRemoteImageManagerDownloadOptions options with which to fetch the image.

` `progress

PINRemoteImageManagerImageCompletion block which will be called to update progress of the image download.

` `completion

PINRemoteImageManagerImageCompletion block to call when image has been fetched from the cache or downloaded.

`

An NSUUID which uniquely identifies this request. To be used for canceling requests and verifying that the callback is for the request you expect (see categories for example).

//api/name/downloadImageWithURL:options:progress:completion:

//apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURL:options:processorKey:processor:completion:

Download or retrieve from cache the image found at the url and process it before calling completion. All completions are called on an arbitrary callback queue unless called on the main thread and the result is in the memory cache (this is an optimization to allow synchronous results for the UI when an object is cached in memory).

PINRemoteImageManager.h - (NSUUID *)downloadImageWithURL:(NSURL *)url options:(PINRemoteImageManagerDownloadOptions)options processorKey:(NSString *)processorKey processor:(PINRemoteImageManagerImageProcessor)processor completion:(PINRemoteImageManagerImageCompletion)completion `url

NSURL where the image to download resides.

` `options

PINRemoteImageManagerDownloadOptions options with which to fetch the image.

` `processorKey

NSString key to uniquely identify processor and process. Will be used for caching processed images.

` `processor

PINRemoteImageManagerImageProcessor block which will be called to post-process downloaded image.

` `completion

PINRemoteImageManagerImageCompletion block to call when image has been fetched from the cache or downloaded.

`

An NSUUID which uniquely identifies this request. To be used for canceling requests and verifying that the callback is for the request you expect (see categories for example).

//api/name/downloadImageWithURL:options:processorKey:processor:completion:

//apple_ref/occ/instm/PINRemoteImageManager/downloadImageWithURLs:options:progress:completion:

Download or retrieve from cache one of the images found at the urls in the passed in array based on current network performance. URLs should be sorted from lowest quality image URL to highest. All completions are called on an arbitrary callback queue unless called on the main thread and the result is in the memory cache (this is an optimization to allow synchronous results for the UI when an object is cached in memory).

PINRemoteImageManager.h - (NSUUID *)downloadImageWithURLs:(NSArray *)urls options:(PINRemoteImageManagerDownloadOptions)options progress:(PINRemoteImageManagerImageCompletion)progress completion:(PINRemoteImageManagerImageCompletion)completion `urls

An array of NSURLs of increasing size.

` `options

PINRemoteImageManagerDownloadOptions options with which to fetch the image.

` `progress

PINRemoteImageManagerImageCompletion block which will be called to update progress of the image download.

` `completion

PINRemoteImageManagerImageCompletion block to call when image has been fetched from the cache or downloaded.

`

An NSUUID which uniquely identifies this request. To be used for canceling requests and verifying that the callback is for the request you expect (see categories for example).

//api/name/downloadImageWithURLs:options:progress:completion:

//apple_ref/occ/instm/PINRemoteImageManager/cacheKeyForURL:processorKey:

Returns the cacheKey for a given URL and processorKey. Exposed to be overridden if necessary or to be used with imageFromCacheWithCacheKey

PINRemoteImageManager.h //apple_ref/occ/instm/PINRemoteImageManager/imageFromCacheWithCacheKey:completion: - (NSString *)cacheKeyForURL:(NSURL *)url processorKey:(NSString *)processorKey `url

NSURL to be downloaded

` `processorKey

NSString key to uniquely identify processor and process.

`

returns an NSString which is the key used for caching.

//api/name/cacheKeyForURL:processorKey:

//apple_ref/occ/instm/PINRemoteImageManager/imageFromCacheWithCacheKey:completion:

Directly get an image from the underlying cache.

PINRemoteImageManager.h //apple_ref/occ/instm/PINRemoteImageManager/cacheKeyForURL:processorKey: - (void)imageFromCacheWithCacheKey:(NSString *)cacheKey completion:(PINRemoteImageManagerImageCompletion)completion `cacheKey

NSString key to look up image in the cache.

` `completion

PINRemoteImageManagerImageCompletion block to call when image has been fetched from the cache.

` //api/name/imageFromCacheWithCacheKey:completion:

//apple_ref/occ/instm/PINRemoteImageManager/cancelTaskWithUUID:

Cancel a download. Canceling will only cancel the download if all other downloads are also canceled with their associated UUIDs. Canceling does not guarantee that your completion will not be called. You can use the UUID provided on the result object verify the completion you want called is being called.

PINRemoteImageManager.h //apple_ref/occ/cl/PINRemoteImageCategoryManager - (void)cancelTaskWithUUID:(NSUUID *)UUID `UUID

NSUUID of the task to cancel.

` //api/name/cancelTaskWithUUID:

//apple_ref/occ/instm/PINRemoteImageManager/setPriority:ofTaskWithUUID:

Set the priority of a download task. Since there is only one task per download, the priority of the download task will always be the last priority this method was called with.

PINRemoteImageManager.h - (void)setPriority:(PINRemoteImageManagerPriority)priority ofTaskWithUUID:(NSUUID *)UUID `priority

priority to set on the task.

` `UUID

NSUUID of the task to set the priority on.

` //api/name/setPriority:ofTaskWithUUID: