|
LuxChat
2.0
Instant messenger for iOS
|
#import <SDImageCache.h>
Instance Methods | |
| (id) | - initWithNamespace: |
| (NSString *) | - makeDiskCachePath: |
| (void) | - addReadOnlyCachePath: |
| (void) | - storeImage:forKey: |
| (void) | - storeImage:forKey:toDisk: |
| (void) | - storeImage:recalculateFromImage:imageData:forKey:toDisk: |
| (NSOperation *) | - queryDiskCacheForKey:done: |
| (UIImage *) | - imageFromMemoryCacheForKey: |
| (UIImage *) | - imageFromDiskCacheForKey: |
| (void) | - removeImageForKey: |
| (void) | - removeImageForKey:withCompletion: |
| (void) | - removeImageForKey:fromDisk: |
| (void) | - removeImageForKey:fromDisk:withCompletion: |
| (void) | - clearMemory |
| (void) | - clearDiskOnCompletion: |
| (void) | - clearDisk |
| (void) | - cleanDiskWithCompletionBlock: |
| (void) | - cleanDisk |
| (NSUInteger) | - getSize |
| (NSUInteger) | - getDiskCount |
| (void) | - calculateSizeWithCompletionBlock: |
| (void) | - diskImageExistsWithKey:completion: |
| (BOOL) | - diskImageExistsWithKey: |
| (NSString *) | - cachePathForKey:inPath: |
| (NSString *) | - defaultCachePathForKey: |
Class Methods | |
| (SDImageCache *) | + sharedImageCache |
Properties | |
| BOOL | shouldDecompressImages |
| NSUInteger | maxMemoryCost |
| NSUInteger | maxMemoryCountLimit |
| NSInteger | maxCacheAge |
| NSUInteger | maxCacheSize |
SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed asynchronous so it doesn’t add unnecessary latency to the UI.
| - (void) addReadOnlyCachePath: | (NSString *) | path |
Add a read-only cache path to search for images pre-cached by SDImageCache Useful if you want to bundle pre-loaded images with your app
| path | The path to use for this read-only cache path |
| - (NSString *) cachePathForKey: | (NSString *) | key | |
| inPath: | (NSString *) | path | |
Get the cache path for a certain key (needs the cache path root folder)
| key | the key (can be obtained from url using cacheKeyForURL) |
| path | the cach path root folder |
| - (void) calculateSizeWithCompletionBlock: | (SDWebImageCalculateSizeBlock) | completionBlock |
Asynchronously calculate the disk cache's size.
| - (void) cleanDisk |
Remove all expired cached image from disk
| - (void) cleanDiskWithCompletionBlock: | (SDWebImageNoParamsBlock) | completionBlock |
Remove all expired cached image from disk. Non-blocking method - returns immediately.
| completionBlock | An block that should be executed after cache expiration completes (optional) |
| - (void) clearDisk |
Clear all disk cached images
| - (void) clearDiskOnCompletion: | (SDWebImageNoParamsBlock) | completion |
Clear all disk cached images. Non-blocking method - returns immediately.
| completion | An block that should be executed after cache expiration completes (optional) |
| - (void) clearMemory |
Clear all memory cached images
| - (NSString *) defaultCachePathForKey: | (NSString *) | key |
Get the default cache path for a certain key
| key | the key (can be obtained from url using cacheKeyForURL) |
| - (BOOL) diskImageExistsWithKey: | (NSString *) | key |
Check if image exists in disk cache already (does not load the image)
| key | the key describing the url |
| - (void) diskImageExistsWithKey: | (NSString *) | key | |
| completion: | (SDWebImageCheckCacheCompletionBlock) | completionBlock | |
Async check if image exists in disk cache already (does not load the image)
| key | the key describing the url |
| completionBlock | the block to be executed when the check is done. |
| - (NSUInteger) getDiskCount |
Get the number of images in the disk cache
| - (NSUInteger) getSize |
Get the size used by the disk cache
| - (UIImage *) imageFromDiskCacheForKey: | (NSString *) | key |
Query the disk cache synchronously after checking the memory cache.
| key | The unique key used to store the wanted image |
| - (UIImage *) imageFromMemoryCacheForKey: | (NSString *) | key |
Query the memory cache synchronously.
| key | The unique key used to store the wanted image |
| - (id) initWithNamespace: | (NSString *) | ns |
Init a new cache store with a specific namespace
| ns | The namespace to use for this cache store |
| - (NSOperation *) queryDiskCacheForKey: | (NSString *) | key | |
| done: | (SDWebImageQueryCompletedBlock) | doneBlock | |
Query the disk cache asynchronously.
| key | The unique key used to store the wanted image |
| - (void) removeImageForKey: | (NSString *) | key |
Remove the image from memory and disk cache synchronously
| key | The unique image cache key |
| - (void) removeImageForKey: | (NSString *) | key | |
| fromDisk: | (BOOL) | fromDisk | |
Remove the image from memory and optionally disk cache asynchronously
| key | The unique image cache key |
| fromDisk | Also remove cache entry from disk if YES |
| - (void) removeImageForKey: | (NSString *) | key | |
| fromDisk: | (BOOL) | fromDisk | |
| withCompletion: | (SDWebImageNoParamsBlock) | completion | |
Remove the image from memory and optionally disk cache asynchronously
| key | The unique image cache key |
| fromDisk | Also remove cache entry from disk if YES |
| completion | An block that should be executed after the image has been removed (optional) |
| - (void) removeImageForKey: | (NSString *) | key | |
| withCompletion: | (SDWebImageNoParamsBlock) | completion | |
Remove the image from memory and disk cache asynchronously
| key | The unique image cache key |
| completion | An block that should be executed after the image has been removed (optional) |
| + (SDImageCache *) sharedImageCache |
Returns global shared cache instance
| - (void) storeImage: | (UIImage *) | image | |
| forKey: | (NSString *) | key | |
Store an image into memory and disk cache at the given key.
| image | The image to store |
| key | The unique image cache key, usually it's image absolute URL |
| - (void) storeImage: | (UIImage *) | image | |
| forKey: | (NSString *) | key | |
| toDisk: | (BOOL) | toDisk | |
Store an image into memory and optionally disk cache at the given key.
| image | The image to store |
| key | The unique image cache key, usually it's image absolute URL |
| toDisk | Store the image to disk cache if YES |
| - (void) storeImage: | (UIImage *) | image | |
| recalculateFromImage: | (BOOL) | recalculate | |
| imageData: | (NSData *) | imageData | |
| forKey: | (NSString *) | key | |
| toDisk: | (BOOL) | toDisk | |
Store an image into memory and optionally disk cache at the given key.
| image | The image to store |
| recalculate | BOOL indicates if imageData can be used or a new data should be constructed from the UIImage |
| imageData | The image data as returned by the server, this representation will be used for disk storage instead of converting the given image object into a storable/compressed image format in order to save quality and CPU |
| key | The unique image cache key, usually it's image absolute URL |
| toDisk | Store the image to disk cache if YES |
|
readwritenonatomicassign |
The maximum length of time to keep an image in the cache, in seconds
|
readwritenonatomicassign |
The maximum size of the cache, in bytes.
|
readwritenonatomicassign |
The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory.
|
readwritenonatomicassign |
The maximum number of objects the cache should hold.
|
readwritenonatomicassign |
Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory. Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.
1.8.9.1