# PINRemoteImageCategory Protocol Reference

Conforms to | NSObject
Declared in | PINRemoteImageCategoryManager.h

## Overview

Protocol to implement on UIView subclasses to support PINRemoteImage

### `– pin_setImageFromURL:` required method

Set the image from the given URL.

`- (void)pin_setImageFromURL:(nullable NSURL *)url`

#### Parameters

`url` | NSURL to fetch from.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:placeholderImage:` required method

Set the image from the given URL and set placeholder image while image at URL is being retrieved.

`- (void)pin_setImageFromURL:(nullable NSURL *)url placeholderImage:(nullable PINImage *)placeholderImage`

#### Parameters

`url` | NSURL to fetch from.
`placeholderImage` | PINImage to set on the view while the image at URL is being retrieved.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:completion:` required method

Set the image from the given URL and call completion when finished.

`- (void)pin_setImageFromURL:(nullable NSURL *)url completion:(nullable PINRemoteImageManagerImageCompletion)completion`

#### Parameters

`url` | NSURL to fetch from.
`completion` | Called when url has been retrieved and set on view.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:placeholderImage:completion:` required method

Set the image from the given URL, set placeholder while image at url is being retrieved and call completion when finished.

`- (void)pin_setImageFromURL:(nullable NSURL *)url placeholderImage:(nullable PINImage *)placeholderImage completion:(nullable PINRemoteImageManagerImageCompletion)completion`

#### Parameters

`url` | NSURL to fetch from.
`placeholderImage` | PINImage to set on the view while the image at URL is being retrieved.
`completion` | Called when url has been retrieved and set on view.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:processorKey:processor:` required method

Retrieve the image from the given URL, process it using the passed in processor block and set result on view.

`- (void)pin_setImageFromURL:(nullable NSURL *)url processorKey:(nullable NSString *)processorKey processor:(nullable PINRemoteImageManagerImageProcessor)processor`

#### Parameters

`url` | NSURL to fetch from.
`processorKey` | NSString key to uniquely identify processor. Used in caching.
`processor` | PINRemoteImageManagerImageProcessor processor block which should return the processed image.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:placeholderImage:processorKey:processor:` required method

Set placeholder on view and retrieve the image from the given URL, process it using the passed in processor block and set result on view.

`- (void)pin_setImageFromURL:(nullable NSURL *)url placeholderImage:(nullable PINImage *)placeholderImage processorKey:(nullable NSString *)processorKey processor:(nullable PINRemoteImageManagerImageProcessor)processor`

#### Parameters

`url` | NSURL to fetch from.
`placeholderImage` | PINImage to set on the view while the image at URL is being retrieved.
`processorKey` | NSString key to uniquely identify processor. Used in caching.
`processor` | PINRemoteImageManagerImageProcessor processor block which should return the processed image.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:processorKey:processor:completion:` required method

Retrieve the image from the given URL, process it using the passed in processor block and set result on view. Call completion after image has been fetched, processed and set on view.

`- (void)pin_setImageFromURL:(nullable NSURL *)url processorKey:(nullable NSString *)processorKey processor:(nullable PINRemoteImageManagerImageProcessor)processor completion:(nullable PINRemoteImageManagerImageCompletion)completion`

#### Parameters

`url` | NSURL to fetch from.
`processorKey` | NSString key to uniquely identify processor. Used in caching.
`processor` | PINRemoteImageManagerImageProcessor processor block which should return the processed image.
`completion` | Called when url has been retrieved and set on view.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURL:placeholderImage:processorKey:processor:completion:` required method

Set placeholder on view and retrieve the image from the given URL, process it using the passed in processor block and set result on view. Call completion after image has been fetched, processed and set on view.

`- (void)pin_setImageFromURL:(nullable NSURL *)url placeholderImage:(nullable PINImage *)placeholderImage processorKey:(nullable NSString *)processorKey processor:(nullable PINRemoteImageManagerImageProcessor)processor completion:(nullable PINRemoteImageManagerImageCompletion)completion`

#### Parameters

`url` | NSURL to fetch from.
`placeholderImage` | PINImage to set on the view while the image at URL is being retrieved.
`processorKey` | NSString key to uniquely identify processor. Used in caching.
`processor` | PINRemoteImageManagerImageProcessor processor block which should return the processed image.
`completion` | Called when url has been retrieved and set on view.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURLs:` required method

Retrieve one of the images at the passed in URLs depending on previous network performance and set result on view.

`- (void)pin_setImageFromURLs:(nullable NSArray<NSURL*> *)urls`

#### Parameters

`urls` | NSArray of NSURLs sorted in increasing quality

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURLs:placeholderImage:` required method

Set placeholder on view and retrieve one of the images at the passed in URLs depending on previous network performance and set result on view.

`- (void)pin_setImageFromURLs:(nullable NSArray<NSURL*> *)urls placeholderImage:(nullable PINImage *)placeholderImage`

#### Parameters

`urls` | NSArray of NSURLs sorted in increasing quality
`placeholderImage` | PINImage to set on the view while the image at URL is being retrieved.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setImageFromURLs:placeholderImage:completion:` required method

Set placeholder on view and retrieve one of the images at the passed in URLs depending on previous network performance and set result on view. Call completion after image has been fetched and set on view.

`- (void)pin_setImageFromURLs:(nullable NSArray<NSURL*> *)urls placeholderImage:(nullable PINImage *)placeholderImage completion:(nullable PINRemoteImageManagerImageCompletion)completion`

#### Parameters

`urls` | NSArray of NSURLs sorted in increasing quality
`placeholderImage` | PINImage to set on the view while the image at URL is being retrieved.
`completion` | Called when url has been retrieved and set on view.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_cancelImageDownload` required method

Cancels the image download. Guarantees that previous setImage calls will not have their results set on the image view after calling this (as opposed to PINRemoteImageManager which does not guarantee cancellation).

`- (void)pin_cancelImageDownload`

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_downloadImageOperationUUID` required method

Returns the NSUUID associated with any PINRemoteImage task currently running on the view.

`- (nullable NSUUID *)pin_downloadImageOperationUUID`

#### Return Value

NSUUID associated with any PINRemoteImage task currently running on the view.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_setDownloadImageOperationUUID:` required method

Set the current NSUUID associated with a PINRemoteImage task running on the view.

`- (void)pin_setDownloadImageOperationUUID:(nullable NSUUID *)downloadImageOperationUUID`

#### Parameters

`downloadImageOperationUUID` | NSUUID associated with a PINRemoteImage task.

#### Declared In

`PINRemoteImageCategoryManager.h`

### `pin_updateWithProgress` required method

Whether the view should update with progress images (such as those provided by progressive JPEG images).

`@property (nonatomic, assign) BOOL pin_updateWithProgress`

#### Return Value

BOOL value indicating whether the view should update with progress images

#### Declared In

`PINRemoteImageCategoryManager.h`

### `– pin_updateUIWithRemoteImageManagerResult:`

If you implement this method, it is called instead of pin_updateUIWithImage:animatedImage:

`- (void)pin_updateUIWithRemoteImageManagerResult:(nonnull PINRemoteImageManagerResult *)result`

#### Parameters

`result` | A PINRemoteImageManagerResult

#### Declared In

`PINRemoteImageCategoryManager.h`