Tuya iOS Smart Life App SDK 5.15.0
ThingEncryptImageCache Class Reference

#import <ThingEncryptImageCache.h>

Inheritance diagram for ThingEncryptImageCache:

Instance Methods

(instancetype) - UNAVAILABLE_ATTRIBUTE
 
(nullable UIImage *) - getImageForKey:
 
(nullable UIImage *) - getImageForKey:withType:
 
(void) - getImageForKey:withType:withBlock:
 
(nullable NSData *) - getImageDataForKey:
 
(void) - getImageDataForKey:withBlock:
 
(void) - setImage:forKey:
 
(void) - setImage:forKey:complete:
 
(void) - setImage:imageData:forKey:withType:
 
(void) - setImage:imageData:forKey:withType:complete:
 
(BOOL) - containsImageForKey:
 
(BOOL) - containsImageForKey:withType:
 
(void) - removeImageForKey:
 
(void) - removeImageForKey:completion:
 
(void) - removeImageForKey:withType:
 
(void) - removeImageForKey:withType:completion:
 
(NSUInteger) - totalDiskSize
 
(NSUInteger) - totalDiskCount
 
(nullable NSString *) - cachePathForKey:inPath:
 
(nullable NSString *) - defaultCachePathForKey:
 
(void) - clearAllCache
 
(void) - clearMemory
 
(void) - clearDiskOnCompletion:
 
(void) - clearDiskFromSDWebImage
 
(instancetype) - UNAVAILABLE_ATTRIBUTE
 
(nullable UIImage *) - getImageForKey:
 
(nullable UIImage *) - getImageForKey:withType:
 
(void) - getImageForKey:withType:withBlock:
 
(nullable NSData *) - getImageDataForKey:
 
(void) - getImageDataForKey:withBlock:
 
(void) - setImage:forKey:
 
(void) - setImage:forKey:complete:
 
(void) - setImage:imageData:forKey:withType:
 
(void) - setImage:imageData:forKey:withType:complete:
 
(BOOL) - containsImageForKey:
 
(BOOL) - containsImageForKey:withType:
 
(void) - removeImageForKey:
 
(void) - removeImageForKey:completion:
 
(void) - removeImageForKey:withType:
 
(void) - removeImageForKey:withType:completion:
 
(NSUInteger) - totalDiskSize
 
(NSUInteger) - totalDiskCount
 
(nullable NSString *) - cachePathForKey:inPath:
 
(nullable NSString *) - defaultCachePathForKey:
 
(void) - clearAllCache
 
(void) - clearMemory
 
(void) - clearDiskOnCompletion:
 
(void) - clearDiskFromSDWebImage
 
(instancetype) - UNAVAILABLE_ATTRIBUTE
 
(nullable UIImage *) - getImageForKey:
 
(nullable UIImage *) - getImageForKey:withType:
 
(void) - getImageForKey:withType:withBlock:
 
(nullable NSData *) - getImageDataForKey:
 
(void) - getImageDataForKey:withBlock:
 
(void) - setImage:forKey:
 
(void) - setImage:forKey:complete:
 
(void) - setImage:imageData:forKey:withType:
 
(void) - setImage:imageData:forKey:withType:complete:
 
(BOOL) - containsImageForKey:
 
(BOOL) - containsImageForKey:withType:
 
(void) - removeImageForKey:
 
(void) - removeImageForKey:completion:
 
(void) - removeImageForKey:withType:
 
(void) - removeImageForKey:withType:completion:
 
(NSUInteger) - totalDiskSize
 
(NSUInteger) - totalDiskCount
 
(nullable NSString *) - cachePathForKey:inPath:
 
(nullable NSString *) - defaultCachePathForKey:
 
(void) - clearAllCache
 
(void) - clearMemory
 
(void) - clearDiskOnCompletion:
 
(void) - clearDiskFromSDWebImage
 
(instancetype) - UNAVAILABLE_ATTRIBUTE
 
(nullable UIImage *) - getImageForKey:
 
(nullable UIImage *) - getImageForKey:withType:
 
(void) - getImageForKey:withType:withBlock:
 
(nullable NSData *) - getImageDataForKey:
 
(void) - getImageDataForKey:withBlock:
 
(void) - setImage:forKey:
 
(void) - setImage:forKey:complete:
 
(void) - setImage:imageData:forKey:withType:
 
(void) - setImage:imageData:forKey:withType:complete:
 
(BOOL) - containsImageForKey:
 
(BOOL) - containsImageForKey:withType:
 
(void) - removeImageForKey:
 
(void) - removeImageForKey:completion:
 
(void) - removeImageForKey:withType:
 
(void) - removeImageForKey:withType:completion:
 
(NSUInteger) - totalDiskSize
 
(NSUInteger) - totalDiskCount
 
(nullable NSString *) - cachePathForKey:inPath:
 
(nullable NSString *) - defaultCachePathForKey:
 
(void) - clearAllCache
 
(void) - clearMemory
 
(void) - clearDiskOnCompletion:
 
(void) - clearDiskFromSDWebImage
 

Class Methods

(instancetype) + UNAVAILABLE_ATTRIBUTE
 
(instancetype) + sharedCache
 
(instancetype) + UNAVAILABLE_ATTRIBUTE
 
(instancetype) + sharedCache
 
(instancetype) + UNAVAILABLE_ATTRIBUTE
 
(instancetype) + sharedCache
 
(instancetype) + UNAVAILABLE_ATTRIBUTE
 
(instancetype) + sharedCache
 

Properties

ThingEncryptMemoryCachememoryCache
 
ThingEncryptDiskCachediskCache
 
BOOL allowAnimatedImage
 
BOOL decodeForDisplay
 

Detailed Description

Definition at line 29 of file ThingEncryptImageCache.h.

Method Documentation

◆ cachePathForKey:inPath: [1/4]

- (nullable NSString *) cachePathForKey: (nullable NSString *)  key
inPath: (nonnull NSString *)  path 

Get the cache path for a certain key (needs the cache path root folder)

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
paththe cache path root folder
Returns
the cache path

◆ cachePathForKey:inPath: [2/4]

- (nullable NSString *) cachePathForKey: (nullable NSString *)  key
inPath: (nonnull NSString *)  path 

Get the cache path for a certain key (needs the cache path root folder)

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
paththe cache path root folder
Returns
the cache path

◆ cachePathForKey:inPath: [3/4]

- (nullable NSString *) cachePathForKey: (nullable NSString *)  key
inPath: (nonnull NSString *)  path 

Get the cache path for a certain key (needs the cache path root folder)

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
paththe cache path root folder
Returns
the cache path

◆ cachePathForKey:inPath: [4/4]

- (nullable NSString *) cachePathForKey: (nullable NSString *)  key
inPath: (nonnull NSString *)  path 

Get the cache path for a certain key (needs the cache path root folder)

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
paththe cache path root folder
Returns
the cache path

◆ clearAllCache [1/4]

- (void) clearAllCache

Clear all cache, include memory and disk.

◆ clearAllCache [2/4]

- (void) clearAllCache

Clear all cache, include memory and disk.

◆ clearAllCache [3/4]

- (void) clearAllCache

Clear all cache, include memory and disk.

◆ clearAllCache [4/4]

- (void) clearAllCache

Clear all cache, include memory and disk.

◆ clearDiskFromSDWebImage [1/4]

- (void) clearDiskFromSDWebImage

Clear the disk cache from SDWebImage. Use this method to clear the history cache data, if you are migrating from SDWebImage. Only clear the data cache by sharedImageCache instance of SDImageCache, not include the specific cache path.

◆ clearDiskFromSDWebImage [2/4]

- (void) clearDiskFromSDWebImage

Clear the disk cache from SDWebImage. Use this method to clear the history cache data, if you are migrating from SDWebImage. Only clear the data cache by sharedImageCache instance of SDImageCache, not include the specific cache path.

◆ clearDiskFromSDWebImage [3/4]

- (void) clearDiskFromSDWebImage

Clear the disk cache from SDWebImage. Use this method to clear the history cache data, if you are migrating from SDWebImage. Only clear the data cache by sharedImageCache instance of SDImageCache, not include the specific cache path.

◆ clearDiskFromSDWebImage [4/4]

- (void) clearDiskFromSDWebImage

Clear the disk cache from SDWebImage. Use this method to clear the history cache data, if you are migrating from SDWebImage. Only clear the data cache by sharedImageCache instance of SDImageCache, not include the specific cache path.

◆ clearDiskOnCompletion: [1/4]

- (void) clearDiskOnCompletion: (void(^)(void))  completion

Clear all disk cache.

Parameters
completionA completion block which will be called on main thread.

◆ clearDiskOnCompletion: [2/4]

- (void) clearDiskOnCompletion: (void(^)(void))  completion

Clear all disk cache.

Parameters
completionA completion block which will be called on main thread.

◆ clearDiskOnCompletion: [3/4]

- (void) clearDiskOnCompletion: (void(^)(void))  completion

Clear all disk cache.

Parameters
completionA completion block which will be called on main thread.

◆ clearDiskOnCompletion: [4/4]

- (void) clearDiskOnCompletion: (void(^)(void))  completion

Clear all disk cache.

Parameters
completionA completion block which will be called on main thread.

◆ clearMemory [1/4]

- (void) clearMemory

Clear all memory cache.

◆ clearMemory [2/4]

- (void) clearMemory

Clear all memory cache.

◆ clearMemory [3/4]

- (void) clearMemory

Clear all memory cache.

◆ clearMemory [4/4]

- (void) clearMemory

Clear all memory cache.

◆ containsImageForKey: [1/4]

- (BOOL) containsImageForKey: (NSString *)  key

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
Returns
Whether the image is in cache.

◆ containsImageForKey: [2/4]

- (BOOL) containsImageForKey: (NSString *)  key

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
Returns
Whether the image is in cache.

◆ containsImageForKey: [3/4]

- (BOOL) containsImageForKey: (NSString *)  key

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
Returns
Whether the image is in cache.

◆ containsImageForKey: [4/4]

- (BOOL) containsImageForKey: (NSString *)  key

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
Returns
Whether the image is in cache.

◆ containsImageForKey:withType: [1/4]

- (BOOL) containsImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory and the type contains YYImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
typeThe cache type.
Returns
Whether the image is in cache.

◆ containsImageForKey:withType: [2/4]

- (BOOL) containsImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory and the type contains YYImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
typeThe cache type.
Returns
Whether the image is in cache.

◆ containsImageForKey:withType: [3/4]

- (BOOL) containsImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory and the type contains YYImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
typeThe cache type.
Returns
Whether the image is in cache.

◆ containsImageForKey:withType: [4/4]

- (BOOL) containsImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns a Boolean value that indicates whether a given key is in cache. If the image is not in memory and the type contains YYImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return NO.
typeThe cache type.
Returns
Whether the image is in cache.

◆ defaultCachePathForKey: [1/4]

- (nullable NSString *) defaultCachePathForKey: (nullable NSString *)  key

Get the default cache path for a certain key

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
Returns
the default cache path

◆ defaultCachePathForKey: [2/4]

- (nullable NSString *) defaultCachePathForKey: (nullable NSString *)  key

Get the default cache path for a certain key

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
Returns
the default cache path

◆ defaultCachePathForKey: [3/4]

- (nullable NSString *) defaultCachePathForKey: (nullable NSString *)  key

Get the default cache path for a certain key

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
Returns
the default cache path

◆ defaultCachePathForKey: [4/4]

- (nullable NSString *) defaultCachePathForKey: (nullable NSString *)  key

Get the default cache path for a certain key

Parameters
keythe key (can be obtained from url using cacheKeyForURL)
Returns
the default cache path

◆ getImageDataForKey: [1/4]

- (nullable NSData *) getImageDataForKey: (NSString *)  key

Returns the image data associated with a given key. This method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image data associated with key, or nil if no image is associated with key.

◆ getImageDataForKey: [2/4]

- (nullable NSData *) getImageDataForKey: (NSString *)  key

Returns the image data associated with a given key. This method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image data associated with key, or nil if no image is associated with key.

◆ getImageDataForKey: [3/4]

- (nullable NSData *) getImageDataForKey: (NSString *)  key

Returns the image data associated with a given key. This method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image data associated with key, or nil if no image is associated with key.

◆ getImageDataForKey: [4/4]

- (nullable NSData *) getImageDataForKey: (NSString *)  key

Returns the image data associated with a given key. This method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image data associated with key, or nil if no image is associated with key.

◆ getImageDataForKey:withBlock: [1/4]

- (void) getImageDataForKey: (NSString *)  key
withBlock: (void(^)(NSData *_Nullable imageData))  block 

Asynchronously get the image data associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
blockA completion block which will be called on main thread.

◆ getImageDataForKey:withBlock: [2/4]

- (void) getImageDataForKey: (NSString *)  key
withBlock: (void(^)(NSData *_Nullable imageData))  block 

Asynchronously get the image data associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
blockA completion block which will be called on main thread.

◆ getImageDataForKey:withBlock: [3/4]

- (void) getImageDataForKey: (NSString *)  key
withBlock: (void(^)(NSData *_Nullable imageData))  block 

Asynchronously get the image data associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
blockA completion block which will be called on main thread.

◆ getImageDataForKey:withBlock: [4/4]

- (void) getImageDataForKey: (NSString *)  key
withBlock: (void(^)(NSData *_Nullable imageData))  block 

Asynchronously get the image data associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
blockA completion block which will be called on main thread.

◆ getImageForKey: [1/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key

Returns the image associated with a given key. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey: [2/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key

Returns the image associated with a given key. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey: [3/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key

Returns the image associated with a given key. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey: [4/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key

Returns the image associated with a given key. If the image is not in memory, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey:withType: [1/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns the image associated with a given key. If the image is not in memory and the type contains ThingEncryptImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey:withType: [2/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns the image associated with a given key. If the image is not in memory and the type contains ThingEncryptImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey:withType: [3/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns the image associated with a given key. If the image is not in memory and the type contains ThingEncryptImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey:withType: [4/4]

- (nullable UIImage *) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Returns the image associated with a given key. If the image is not in memory and the type contains ThingEncryptImageCacheTypeDisk, this method may blocks the calling thread until file read finished.

Parameters
keyA string identifying the image. If nil, just return nil.
Returns
The image associated with key, or nil if no image is associated with key.

◆ getImageForKey:withType:withBlock: [1/4]

- (void) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
withBlock: (void(^)(UIImage *_Nullable image, ThingEncryptImageCacheType type))  block 

Asynchronously get the image associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
typeThe cache type.
blockA completion block which will be called on main thread.

◆ getImageForKey:withType:withBlock: [2/4]

- (void) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
withBlock: (void(^)(UIImage *_Nullable image, ThingEncryptImageCacheType type))  block 

Asynchronously get the image associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
typeThe cache type.
blockA completion block which will be called on main thread.

◆ getImageForKey:withType:withBlock: [3/4]

- (void) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
withBlock: (void(^)(UIImage *_Nullable image, ThingEncryptImageCacheType type))  block 

Asynchronously get the image associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
typeThe cache type.
blockA completion block which will be called on main thread.

◆ getImageForKey:withType:withBlock: [4/4]

- (void) getImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
withBlock: (void(^)(UIImage *_Nullable image, ThingEncryptImageCacheType type))  block 

Asynchronously get the image associated with a given key.

Parameters
keyA string identifying the image. If nil, just return nil.
typeThe cache type.
blockA completion block which will be called on main thread.

◆ removeImageForKey: [1/4]

- (void) removeImageForKey: (NSString *)  key

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.

◆ removeImageForKey: [2/4]

- (void) removeImageForKey: (NSString *)  key

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.

◆ removeImageForKey: [3/4]

- (void) removeImageForKey: (NSString *)  key

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.

◆ removeImageForKey: [4/4]

- (void) removeImageForKey: (NSString *)  key

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.

◆ removeImageForKey:completion: [1/4]

- (void) removeImageForKey: (NSString *)  key
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
completionA completion block which will be called on main thread.

◆ removeImageForKey:completion: [2/4]

- (void) removeImageForKey: (NSString *)  key
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
completionA completion block which will be called on main thread.

◆ removeImageForKey:completion: [3/4]

- (void) removeImageForKey: (NSString *)  key
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
completionA completion block which will be called on main thread.

◆ removeImageForKey:completion: [4/4]

- (void) removeImageForKey: (NSString *)  key
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache (both memory and disk). This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
completionA completion block which will be called on main thread.

◆ removeImageForKey:withType: [1/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.

◆ removeImageForKey:withType: [2/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.

◆ removeImageForKey:withType: [3/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.

◆ removeImageForKey:withType: [4/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.

◆ removeImageForKey:withType:completion: [1/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.
completionA completion block which will be called on main thread.

◆ removeImageForKey:withType:completion: [2/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.
completionA completion block which will be called on main thread.

◆ removeImageForKey:withType:completion: [3/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.
completionA completion block which will be called on main thread.

◆ removeImageForKey:withType:completion: [4/4]

- (void) removeImageForKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
completion: (nullable void(^)(void))  completion 

Removes the image of the specified key in the cache. This method returns immediately and executes the remove operation in background.

Parameters
keyThe key identifying the image to be removed. If nil, this method has no effect.
typeThe cache type to remove image.
completionA completion block which will be called on main thread.

◆ setImage:forKey: [1/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.

◆ setImage:forKey: [2/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.

◆ setImage:forKey: [3/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.

◆ setImage:forKey: [4/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.

◆ setImage:forKey:complete: [1/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.
completeA completion block which will be called on main thread.

◆ setImage:forKey:complete: [2/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.
completeA completion block which will be called on main thread.

◆ setImage:forKey:complete: [3/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.
completeA completion block which will be called on main thread.

◆ setImage:forKey:complete: [4/4]

- (void) setImage: (UIImage *)  image
forKey: (NSString *)  key
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache (both memory and disk). This method returns immediately and executes the store operation in background.

Parameters
imageThe image to be stored in the cache. If nil, this method has no effect.
keyThe key with which to associate the image. If nil, this method has no effect.
completeA completion block which will be called on main thread.

◆ setImage:imageData:forKey:withType: [1/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.

◆ setImage:imageData:forKey:withType: [2/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.

◆ setImage:imageData:forKey:withType: [3/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.

◆ setImage:imageData:forKey:withType: [4/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.

◆ setImage:imageData:forKey:withType:complete: [1/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.
completeA completion block which will be called on main thread.

◆ setImage:imageData:forKey:withType:complete: [2/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.
completeA completion block which will be called on main thread.

◆ setImage:imageData:forKey:withType:complete: [3/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.
completeA completion block which will be called on main thread.

◆ setImage:imageData:forKey:withType:complete: [4/4]

- (void) setImage: (nullable UIImage *)  image
imageData: (nullable NSData *)  imageData
forKey: (NSString *)  key
withType: (ThingEncryptImageCacheType)  type
complete: (nullable void(^)(void))  complete 

Sets the image with the specified key in the cache. This method returns immediately and executes the store operation in background.

@discussion If the type contain ThingEncryptImageCacheTypeMemory, then the image will be stored in the memory cache; imageData will be used instead if image is nil. If the type contain ThingEncryptImageCacheTypeDisk, then the imageData will be stored in the disk cache; image will be used instead if imageData is nil.

Parameters
imageThe image to be stored in the cache.
imageDataThe image data to be stored in the cache.
keyThe key with which to associate the image. If nil, this method has no effect.
typeThe cache type to store image.
completeA completion block which will be called on main thread.

◆ sharedCache [1/4]

+ (instancetype) sharedCache

Returns global shared image cache instance.

Returns
The singleton ThingImageCache instance.

◆ sharedCache [2/4]

+ (instancetype) sharedCache

Returns global shared image cache instance.

Returns
The singleton ThingImageCache instance.

◆ sharedCache [3/4]

+ (instancetype) sharedCache

Returns global shared image cache instance.

Returns
The singleton ThingImageCache instance.

◆ sharedCache [4/4]

+ (instancetype) sharedCache

Returns global shared image cache instance.

Returns
The singleton ThingImageCache instance.

◆ totalDiskCount [1/4]

- (NSUInteger) totalDiskCount

Get the number of images in the disk cache

◆ totalDiskCount [2/4]

- (NSUInteger) totalDiskCount

Get the number of images in the disk cache

◆ totalDiskCount [3/4]

- (NSUInteger) totalDiskCount

Get the number of images in the disk cache

◆ totalDiskCount [4/4]

- (NSUInteger) totalDiskCount

Get the number of images in the disk cache

◆ totalDiskSize [1/4]

- (NSUInteger) totalDiskSize

Get the total bytes size of images in the disk cache

◆ totalDiskSize [2/4]

- (NSUInteger) totalDiskSize

Get the total bytes size of images in the disk cache

◆ totalDiskSize [3/4]

- (NSUInteger) totalDiskSize

Get the total bytes size of images in the disk cache

◆ totalDiskSize [4/4]

- (NSUInteger) totalDiskSize

Get the total bytes size of images in the disk cache

◆ UNAVAILABLE_ATTRIBUTE [1/8]

+ (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [2/8]

- (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [3/8]

+ (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [4/8]

- (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [5/8]

+ (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [6/8]

- (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [7/8]

+ (instancetype) UNAVAILABLE_ATTRIBUTE

◆ UNAVAILABLE_ATTRIBUTE [8/8]

- (instancetype) UNAVAILABLE_ATTRIBUTE

Property Documentation

◆ allowAnimatedImage

- (BOOL) allowAnimatedImage
readwriteatomic

Whether decode animated image when fetch image from disk cache. Default is YES.

@discussion When fetch image from disk cache, it will use 'ThingInternalEncryptImage' to decode animated image such as WebP/APNG/GIF. Set to 'NO' to ignore animated image.

Definition at line 43 of file ThingEncryptImageCache.h.

◆ decodeForDisplay

- (BOOL) decodeForDisplay
readwriteatomic

Whether decode the image to memory bitmap. Default is YES.

@discussion If the value is YES, then the image will be decoded to memory bitmap for better display performance, but may cost more memory.

Definition at line 51 of file ThingEncryptImageCache.h.

◆ diskCache

- (ThingEncryptDiskCache *) diskCache
readatomicstrong

The underlying disk cache. see ThingEncryptDiskCache for more information.

Definition at line 35 of file ThingEncryptImageCache.h.

◆ memoryCache

- (ThingEncryptMemoryCache *) memoryCache
readatomicstrong

The underlying memory cache. see ThingEncryptMemoryCache for more information.

Definition at line 32 of file ThingEncryptImageCache.h.


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