Tuya iOS Smart Life App SDK 5.15.0
ThingEncryptWebImageManager Class Reference

#import <ThingEncryptWebImageManager.h>

Inheritance diagram for ThingEncryptWebImageManager:

Instance Methods

(instancetype) - initWithCache:queue:
 
(NSString *) - cacheKeyForURL:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:options:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:scaledWidth:options:progress:completion:
 
(void) - prefetchURLs:
 
(void) - clearAllCache
 
(instancetype) - initWithCache:queue:
 
(NSString *) - cacheKeyForURL:
 
(NSDictionary< NSString *, NSString * > *(^)) - headersFilter
 
(NSString *(^)) - cacheKeyFilter
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:options:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:scaledWidth:options:progress:completion:
 
(void) - prefetchURLs:
 
(void) - clearAllCache
 
(instancetype) - initWithCache:queue:
 
(NSString *) - cacheKeyForURL:
 
(NSDictionary< NSString *, NSString * > *(^)) - headersFilter
 
(NSString *(^)) - cacheKeyFilter
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:options:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:scaledWidth:options:progress:completion:
 
(void) - prefetchURLs:
 
(void) - clearAllCache
 
(instancetype) - initWithCache:queue:
 
(NSString *) - cacheKeyForURL:
 
(NSDictionary< NSString *, NSString * > *(^)) - headersFilter
 
(NSString *(^)) - cacheKeyFilter
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:options:progress:completion:
 
(ThingEncryptWebImageOperation *) - requestImageWithURL:scaledWidth:options:progress:completion:
 
(void) - prefetchURLs:
 
(void) - clearAllCache
 

Class Methods

(instancetype) + sharedManager
 
(instancetype) + sharedManager
 
(instancetype) + sharedManager
 
(instancetype) + sharedManager
 

Properties

ThingEncryptImageCachecache
 
NSDictionary< NSString *, NSString * > * headers
 
BOOL isSerial
 
NSTimeInterval timeout
 
NSString * username
 
NSString * password
 
NSDictionary< NSString *, NSString * > *(^ headersFilter )(NSURL *url, NSDictionary< NSString *, NSString * > *_Nullable header)
 
NSString *(^ cacheKeyFilter )(NSURL *url)
 

Detailed Description

Definition at line 16 of file ThingEncryptWebImageManager.h.

Method Documentation

◆ cacheKeyFilter [1/3]

- (NSString *(^)) cacheKeyFilter (NSURL *)  url

A block which will be invoked for each image operation. Default is nil.

Use this block to provide a custom image cache key for a specified URL.

◆ cacheKeyFilter [2/3]

- (NSString *(^)) cacheKeyFilter (NSURL *)  url

A block which will be invoked for each image operation. Default is nil.

Use this block to provide a custom image cache key for a specified URL.

◆ cacheKeyFilter [3/3]

- (NSString *(^)) cacheKeyFilter (NSURL *)  url

A block which will be invoked for each image operation. Default is nil.

Use this block to provide a custom image cache key for a specified URL.

◆ cacheKeyForURL: [1/4]

- (NSString *) cacheKeyForURL: (NSURL *)  url

Returns the cache key for a specified URL.

Parameters
urlA specified URL
Returns
Cache key used in ThingEncryptImageCache.

◆ cacheKeyForURL: [2/4]

- (NSString *) cacheKeyForURL: (NSURL *)  url

Returns the cache key for a specified URL.

Parameters
urlA specified URL
Returns
Cache key used in ThingEncryptImageCache.

◆ cacheKeyForURL: [3/4]

- (NSString *) cacheKeyForURL: (NSURL *)  url

Returns the cache key for a specified URL.

Parameters
urlA specified URL
Returns
Cache key used in ThingEncryptImageCache.

◆ cacheKeyForURL: [4/4]

- (NSString *) cacheKeyForURL: (NSURL *)  url

Returns the cache key for a specified URL.

Parameters
urlA specified URL
Returns
Cache key used in ThingEncryptImageCache.

◆ clearAllCache [1/4]

- (void) clearAllCache

Clear all cached files

◆ clearAllCache [2/4]

- (void) clearAllCache

Clear all cached files

◆ clearAllCache [3/4]

- (void) clearAllCache

Clear all cached files

◆ clearAllCache [4/4]

- (void) clearAllCache

Clear all cached files

◆ headersFilter [1/3]

- (NSDictionary< NSString *, NSString * > *(^)) headersFilter (NSURL *)  url
(NSDictionary< NSString *, NSString * > *_Nullable)  header 

A block which will be invoked for each image HTTP request to do additional HTTP header process. Default is nil.

Use this block to add or remove HTTP header field for a specified URL.

◆ headersFilter [2/3]

- (NSDictionary< NSString *, NSString * > *(^)) headersFilter (NSURL *)  url
(NSDictionary< NSString *, NSString * > *_Nullable)  header 

A block which will be invoked for each image HTTP request to do additional HTTP header process. Default is nil.

Use this block to add or remove HTTP header field for a specified URL.

◆ headersFilter [3/3]

- (NSDictionary< NSString *, NSString * > *(^)) headersFilter (NSURL *)  url
(NSDictionary< NSString *, NSString * > *_Nullable)  header 

A block which will be invoked for each image HTTP request to do additional HTTP header process. Default is nil.

Use this block to add or remove HTTP header field for a specified URL.

◆ initWithCache:queue: [1/4]

- (instancetype) initWithCache: (nullable ThingEncryptImageCache *)  cache
queue: (NSOperationQueue *)  queue 

Creates a manager with an image cache and operation queue.

Parameters
cacheImage cache used by manager (pass nil to avoid image cache).
Returns
A new manager.

◆ initWithCache:queue: [2/4]

- (instancetype) initWithCache: (nullable ThingEncryptImageCache *)  cache
queue: (NSOperationQueue *)  queue 

Creates a manager with an image cache and operation queue.

Parameters
cacheImage cache used by manager (pass nil to avoid image cache).
Returns
A new manager.

◆ initWithCache:queue: [3/4]

- (instancetype) initWithCache: (nullable ThingEncryptImageCache *)  cache
queue: (NSOperationQueue *)  queue 

Creates a manager with an image cache and operation queue.

Parameters
cacheImage cache used by manager (pass nil to avoid image cache).
Returns
A new manager.

◆ initWithCache:queue: [4/4]

- (instancetype) initWithCache: (nullable ThingEncryptImageCache *)  cache
queue: (NSOperationQueue *)  queue 

Creates a manager with an image cache and operation queue.

Parameters
cacheImage cache used by manager (pass nil to avoid image cache).
Returns
A new manager.

◆ prefetchURLs: [1/4]

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

Assign list of URLs to let ThingEncryptWebImageManager to queue the prefetching. Attention that call this will not cancel previous fetched urls.

Parameters
urlslist of URLs to prefetch

◆ prefetchURLs: [2/4]

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

Assign list of URLs to let ThingEncryptWebImageManager to queue the prefetching. Attention that call this will not cancel previous fetched urls.

Parameters
urlslist of URLs to prefetch

◆ prefetchURLs: [3/4]

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

Assign list of URLs to let ThingEncryptWebImageManager to queue the prefetching. Attention that call this will not cancel previous fetched urls.

Parameters
urlslist of URLs to prefetch

◆ prefetchURLs: [4/4]

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

Assign list of URLs to let ThingEncryptWebImageManager to queue the prefetching. Attention that call this will not cancel previous fetched urls.

Parameters
urlslist of URLs to prefetch

◆ requestImageWithURL:options:progress:completion: [1/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:options:progress:completion: [2/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:options:progress:completion: [3/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:options:progress:completion: [4/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:progress:completion: [1/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:progress:completion: [2/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:progress:completion: [3/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:progress:completion: [4/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:scaledWidth:options:progress:completion: [1/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
scaledWidth: (NSInteger)  scaledWidth
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
scaledWidthThe image will be scaled to the specified width, and the height will be adjusted proportionally.
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:scaledWidth:options:progress:completion: [2/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
scaledWidth: (NSInteger)  scaledWidth
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
scaledWidthThe image will be scaled to the specified width, and the height will be adjusted proportionally.
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:scaledWidth:options:progress:completion: [3/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
scaledWidth: (NSInteger)  scaledWidth
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
scaledWidthThe image will be scaled to the specified width, and the height will be adjusted proportionally.
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ requestImageWithURL:scaledWidth:options:progress:completion: [4/4]

- (ThingEncryptWebImageOperation *) requestImageWithURL: (NSURL *)  url
scaledWidth: (NSInteger)  scaledWidth
options: (ThingEncryptWebImageOptions)  options
progress: (nullable ThingEncryptWebImageProgressBlock progress
completion: (nullable ThingEncryptWebImageCompletionBlock completion 

Creates and returns a new image operation, the operation will start immediately.

Parameters
urlThe image url (remote or local file path).
scaledWidthThe image will be scaled to the specified width, and the height will be adjusted proportionally.
optionsThe options to control image operation.
progressProgress block
completionCompletion block
Returns
A new image operation.

◆ sharedManager [1/4]

+ (instancetype) sharedManager

◆ sharedManager [2/4]

+ (instancetype) sharedManager

◆ sharedManager [3/4]

+ (instancetype) sharedManager

◆ sharedManager [4/4]

+ (instancetype) sharedManager

Property Documentation

◆ cache

- (ThingEncryptImageCache *) cache
readwritenonatomicstrong

The image cache used by image operation. You can set it to nil to avoid image cache.

Definition at line 22 of file ThingEncryptWebImageManager.h.

◆ cacheKeyFilter

- (NSString *(^ cacheKeyFilter) (NSURL *url))
readwritenonatomiccopy

A block which will be invoked for each image operation. Default is nil.

Use this block to provide a custom image cache key for a specified URL.

◆ headers

- (NSDictionary< NSString *, NSString * > *) headers
readwritenonatomiccopy

The image HTTP request header. Default is "Accept:image/webp,image/\*;q=0.8".

Definition at line 27 of file ThingEncryptWebImageManager.h.

◆ headersFilter

- (NSDictionary< NSString *, NSString * > *(^ headersFilter) (NSURL *url, NSDictionary< NSString *, NSString * > *_Nullable header))
readwritenonatomiccopy

A block which will be invoked for each image HTTP request to do additional HTTP header process. Default is nil.

Use this block to add or remove HTTP header field for a specified URL.

◆ isSerial

- (BOOL) isSerial
readwritenonatomicassign

Definition at line 32 of file ThingEncryptWebImageManager.h.

◆ password

- (NSString *) password
readwritenonatomiccopy

The password used by NSURLCredential, default is nil.

Definition at line 66 of file ThingEncryptWebImageManager.h.

◆ timeout

- (NSTimeInterval) timeout
readwritenonatomicassign

The image request timeout interval in seconds. Default is 15.

Definition at line 56 of file ThingEncryptWebImageManager.h.

◆ username

- (NSString *) username
readwritenonatomiccopy

The username used by NSURLCredential, default is nil.

Definition at line 61 of file ThingEncryptWebImageManager.h.


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