Tuya iOS Smart Life App SDK 5.15.0
ThingEncryptWebImagePrefetcher Class Reference

#import <ThingEncryptWebImagePrefetcher.h>

Inheritance diagram for ThingEncryptWebImagePrefetcher:

Instance Methods

(nonnull instancetype) - initWithImageManager:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:progress:completed:
 
(void) - cancelPrefetching
 
(nonnull instancetype) - initWithImageManager:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:progress:completed:
 
(void) - cancelPrefetching
 
(nonnull instancetype) - initWithImageManager:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:progress:completed:
 
(void) - cancelPrefetching
 
(nonnull instancetype) - initWithImageManager:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:
 
(nullable ThingEncryptWebImagePrefetchToken *) - prefetchURLs:progress:completed:
 
(void) - cancelPrefetching
 

Properties

ThingEncryptWebImageManagermanager
 
NSUInteger maxConcurrentPrefetchCount
 
dispatch_queue_t delegateQueue
 
id< ThingEncryptWebImagePrefetcherDelegatedelegate
 
ThingEncryptWebImagePrefetchersharedImagePrefetcher
 

Detailed Description

Definition at line 60 of file ThingEncryptWebImagePrefetcher.h.

Method Documentation

◆ cancelPrefetching [1/4]

- (void) cancelPrefetching

Remove and cancel all the prefeching for the prefetcher.

◆ cancelPrefetching [2/4]

- (void) cancelPrefetching

Remove and cancel all the prefeching for the prefetcher.

◆ cancelPrefetching [3/4]

- (void) cancelPrefetching

Remove and cancel all the prefeching for the prefetcher.

◆ cancelPrefetching [4/4]

- (void) cancelPrefetching

Remove and cancel all the prefeching for the prefetcher.

◆ initWithImageManager: [1/4]

- (nonnull instancetype) initWithImageManager: (nonnull ThingEncryptWebImageManager *)  NS_DESIGNATED_INITIALIZER

Allows you to instantiate a prefetcher with any arbitrary image manager.

◆ initWithImageManager: [2/4]

- (nonnull instancetype) initWithImageManager: (nonnull ThingEncryptWebImageManager *)  NS_DESIGNATED_INITIALIZER

Allows you to instantiate a prefetcher with any arbitrary image manager.

◆ initWithImageManager: [3/4]

- (nonnull instancetype) initWithImageManager: (nonnull ThingEncryptWebImageManager *)  NS_DESIGNATED_INITIALIZER

Allows you to instantiate a prefetcher with any arbitrary image manager.

◆ initWithImageManager: [4/4]

- (nonnull instancetype) initWithImageManager: (nonnull ThingEncryptWebImageManager *)  NS_DESIGNATED_INITIALIZER

Allows you to instantiate a prefetcher with any arbitrary image manager.

◆ prefetchURLs: [1/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
Returns
the token to cancel the current prefetching.

◆ prefetchURLs: [2/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
Returns
the token to cancel the current prefetching.

◆ prefetchURLs: [3/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
Returns
the token to cancel the current prefetching.

◆ prefetchURLs: [4/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
Returns
the token to cancel the current prefetching.

◆ prefetchURLs:progress:completed: [1/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls
progress: (nullable ThingEncryptImagePrefetcherProgressBlock progressBlock
completed: (nullable ThingEncryptPrefetcherCompletionBlock completionBlock 

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
progressBlockblock to be called when progress updates; first parameter is the number of completed (successful or not) requests, second parameter is the total number of images originally requested to be prefetched
completionBlockblock to be called when the current prefetching is completed first param is the number of completed (successful or not) requests, second parameter is the number of skipped requests
Returns
the token to cancel the current prefetching.

◆ prefetchURLs:progress:completed: [2/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls
progress: (nullable ThingEncryptImagePrefetcherProgressBlock progressBlock
completed: (nullable ThingEncryptPrefetcherCompletionBlock completionBlock 

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
progressBlockblock to be called when progress updates; first parameter is the number of completed (successful or not) requests, second parameter is the total number of images originally requested to be prefetched
completionBlockblock to be called when the current prefetching is completed first param is the number of completed (successful or not) requests, second parameter is the number of skipped requests
Returns
the token to cancel the current prefetching.

◆ prefetchURLs:progress:completed: [3/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls
progress: (nullable ThingEncryptImagePrefetcherProgressBlock progressBlock
completed: (nullable ThingEncryptPrefetcherCompletionBlock completionBlock 

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
progressBlockblock to be called when progress updates; first parameter is the number of completed (successful or not) requests, second parameter is the total number of images originally requested to be prefetched
completionBlockblock to be called when the current prefetching is completed first param is the number of completed (successful or not) requests, second parameter is the number of skipped requests
Returns
the token to cancel the current prefetching.

◆ prefetchURLs:progress:completed: [4/4]

- (nullable ThingEncryptWebImagePrefetchToken *) prefetchURLs: (nullable NSArray< NSURL * > *)  urls
progress: (nullable ThingEncryptImagePrefetcherProgressBlock progressBlock
completed: (nullable ThingEncryptPrefetcherCompletionBlock completionBlock 

Assign list of URLs to let ThingEncryptWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the options property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.

Parameters
urlslist of URLs to prefetch
progressBlockblock to be called when progress updates; first parameter is the number of completed (successful or not) requests, second parameter is the total number of images originally requested to be prefetched
completionBlockblock to be called when the current prefetching is completed first param is the number of completed (successful or not) requests, second parameter is the number of skipped requests
Returns
the token to cancel the current prefetching.

Property Documentation

◆ delegate

- (id< ThingEncryptWebImagePrefetcherDelegate >) delegate
readwritenonatomicweak

The delegate for the prefetcher. Defaults to nil.

Definition at line 83 of file ThingEncryptWebImagePrefetcher.h.

◆ delegateQueue

- (dispatch_queue_t) delegateQueue
readwritenonatomicstrong

Queue options for prefetcher when call the progressBlock, completionBlock and delegate methods. Defaults to Main Queue.

Note
The call is asynchronously to avoid blocking target queue.
The delegate queue should be set before any prefetching start and may not be changed during prefetching to avoid thread-safe problem.

Definition at line 78 of file ThingEncryptWebImagePrefetcher.h.

◆ manager

- (ThingEncryptWebImageManager *) manager
readnonatomicstrong

The web image manager used by prefetcher to prefetch images.

Note
You can specify a standalone manager with custom configuration suitable for image prefetching.

Definition at line 66 of file ThingEncryptWebImagePrefetcher.h.

◆ maxConcurrentPrefetchCount

- (NSUInteger) maxConcurrentPrefetchCount
readwritenonatomicassign

Maximum number of URLs to prefetch at the same time. Defaults to 3.

Definition at line 71 of file ThingEncryptWebImagePrefetcher.h.

◆ sharedImagePrefetcher

- (ThingEncryptWebImagePrefetcher *) sharedImagePrefetcher
readnonatomicassign

Returns the global shared image prefetcher instance. It use a standalone manager which is different from shared manager.

Definition at line 88 of file ThingEncryptWebImagePrefetcher.h.


The documentation for this class was generated from the following files: