<GCKUIImageCache> 프로토콜
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이미지를 검색하고 캐시하는 수단을 정의하는 프로토콜입니다.
기본 구현은 프레임워크 내부적으로 사용되어 사용자 인터페이스에 표시되는 미디어 아트워크를 캐시합니다. 애플리케이션은 GCKCastContext::imageCache 속성을 설정하여 맞춤 구현을 제공할 수 있습니다.
- 다음 이후:
- 3.0
<NSObject>를 상속합니다.
- (void) fetchImageForURL: |
|
(NSURL *) |
imageURL |
completion: |
|
(void(^)(UIImage *_Nullable)) |
completion |
|
|
| |
지정된 URL에서 이미지를 가져오고 이미지의 배율이 조정된 버전을 반환합니다.
이는 비동기 작업입니다.
- 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. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eGCKUIImageCache\u003c/code\u003e protocol defines how images are retrieved and cached for display within the Google Cast framework.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize image caching by providing their own implementation and setting it on the \u003ccode\u003eGCKCastContext\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003efetchImageForURL:completion:\u003c/code\u003e method retrieves and scales images asynchronously, notifying the caller via a completion block on the main thread.\u003c/p\u003e\n"]]],["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"],null,["# <GCKUIImageCache> Protocol\n\n[Instance Methods](#pub-methods) \n\\\u003cGCKUIImageCache\\\u003e Protocol Reference \n\nOverview\n--------\n\nA protocol that defines a means of retrieving and caching images.\n\nA 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](/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.\n\nSince\n: 3.0\n\nInherits \\\u003cNSObject\\\u003e.\n\n|--------|-------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (void) | - [fetchImageForURL:completion:](/cast/docs/reference/ios/protocol_g_c_k_u_i_image_cache-p#a448a9f34fd1631b69b743882e7af38f4) |\n| | Fetches the image at the given URL, and returns a scaled version of the image. [More...](#a448a9f34fd1631b69b743882e7af38f4) |\n| ||\n\nMethod Detail\n-------------\n\n|----------------------------|---|---------------------------------|--------------|\n| - (void) fetchImageForURL: | | (NSURL \\*) | *imageURL* |\n| completion: | | (void(\\^)(UIImage \\*_Nullable)) | *completion* |\n| | | | |\n\nFetches the image at the given URL, and returns a scaled version of the image.\n\nThis is an asynchronous operation.\n\nParameters\n:\n\n |------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | imageURL | The URL of the image. |\n | 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. |"]]