# &lt;GCKUIImageCache&gt; Protocol

[Instance Methods](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_image_cache-p#pub-methods) \<GCKUIImageCache\> Protocol Reference

## Overview

A protocol that defines a means of retrieving and caching images.

A default implementation is used internally by the framework to cache media artwork that is displayed in the user interface. The application can provide a custom implementation by setting the [GCKCastContext::imageCache](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_cast_context_07_u_i_08#a9b83c154f8700cb322f9cf42738bd98a "The image cache implementation that will be used by the framework to fetch images that are referenced...") property.

Since
:   3.0

Inherits \<NSObject\>.

|---|---|
| ## Instance Method Summary ||
| (void) | - [fetchImageForURL:completion:](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_image_cache-p#a448a9f34fd1631b69b743882e7af38f4) |
|   | Fetches the image at the given URL, and returns a scaled version of the image. [More...](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_image_cache-p#a448a9f34fd1631b69b743882e7af38f4) |
|   ||

## Method Detail

|---|---|---|---|
| - (void) fetchImageForURL: |   | (NSURL \*) | *imageURL* |
| completion: |   | (void(\^)(UIImage \*_Nullable)) | *completion* |
|   |   |   |   |

Fetches the image at the given URL, and returns a scaled version of the image.

This is an asynchronous operation.

Parameters
:

    |---|---|
    | imageURL | The URL of the image. |
    | completion | A block to invoke once the image has been retrieved. The image should be passed to the block. If there was an error retrieving the image, `nil` should be passed instead. The block should only be invoked on the main thread. |