<GCKUIImageCache> प्रोटोकॉल
ऐसा प्रोटोकॉल जो इमेज को वापस पाने और कैश मेमोरी में सेव करने के तरीके के बारे में बताता है.
डिफ़ॉल्ट रूप से लागू करने का फ़्रेमवर्क अंदरूनी तौर पर, यूज़र इंटरफ़ेस में दिखाए गए मीडिया आर्टवर्क को कैश मेमोरी में सेव करने के लिए इस्तेमाल करता है. ऐप्लिकेशन में GCKCastContext::imageCache प्रॉपर्टी को सेट करके, अपने हिसाब से लागू करने की सुविधा मिलती है.
- से
- 3.0
<NSObject> को इनहेरिट करता है.
- (void) fetchImageForURL: |
|
(NSURL *) |
imageURL |
completion: |
|
(void(^)(UIImage *_Nullable)) |
completion |
|
|
| |
दिए गए यूआरएल पर इमेज को फ़ेच करता है और इमेज का स्केल किया गया वर्शन दिखाता है.
यह एक एसिंक्रोनस ऑपरेशन है.
- 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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2023-12-01 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2023-12-01 (UTC) को अपडेट किया गया."],[[["The `GCKUIImageCache` protocol defines how images are retrieved and cached for display within the Google Cast framework."],["Developers can customize image caching by providing their own implementation and setting it on the `GCKCastContext`."],["The `fetchImageForURL:completion:` method retrieves and scales images asynchronously, notifying the caller via a completion block on the main thread."]]],["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"]]