<GCKUIImageCache> ProtocolStay organized with collectionsSave and categorize content based on your preferences.
AI-generated Key Takeaways
GCKUIImageCache is a protocol in the Google Cast SDK for iOS that defines how to retrieve and cache images, primarily used for media artwork displayed in the user interface.
A default implementation of GCKUIImageCache is used internally by the framework, but applications can provide a custom implementation.
The protocol includes an asynchronous instance methodfetchImageForURL:completion:which fetches an image from a given URL and returns a scaled version via a completion block on the main thread.
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 theGCKCastContext::imageCacheproperty.
Fetches the image at the given URL, and returns a scaled version of the image.More...
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,nilshould be passed instead. The block should only be invoked on the main thread.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[],["The `GCKUIImageCache` protocol defines image retrieval and caching. It utilizes a default implementation for media artwork displayed in the user interface, but applications can provide custom implementations via `GCKCastContext::imageCache`. The core functionality is provided by the `fetchImageForURL:completion:` method, which asynchronously fetches an image from a given URL. It then returns a scaled version of the image to the main thread through a completion block, or `nil` if an error occurs.\n"]]