Revert the changes for unused public API, polish comments
This commit is contained in:
parent
1700f9726d
commit
e6a4e74ed5
|
@ -160,17 +160,6 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot
|
||||||
*/
|
*/
|
||||||
- (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key;
|
- (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key;
|
||||||
|
|
||||||
#pragma mark - Update Ops
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update image memory cost if image already be stored in memory.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param key The unique image cache key, usually it's image absolute URL
|
|
||||||
* @note After image be stored in memory cache, if image's memory size changes, such as set a large memory associated object to it, or subclass `UIImage` which has its own large memory properties, you can use this to update memory cost which can make memory cache handle `maxMemoryCost` correctly
|
|
||||||
*/
|
|
||||||
- (void)updateImageMemoryCostWithKey:(nullable NSString *)key;
|
|
||||||
|
|
||||||
#pragma mark - Query and Retrieve Ops
|
#pragma mark - Query and Retrieve Ops
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -359,18 +359,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Update Ops
|
|
||||||
|
|
||||||
- (void)updateImageMemoryCostWithKey:(NSString *)key {
|
|
||||||
UIImage *cachedImage = [self imageFromMemoryCacheForKey:key];
|
|
||||||
// If image can be find in memory cache, we update the cost value of cost.
|
|
||||||
if (cachedImage) {
|
|
||||||
[self removeImageForKey:key fromDisk:NO withCompletion:^{
|
|
||||||
[self storeImage:cachedImage forKey:key toDisk:NO completion:nil];
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Query and Retrieve Ops
|
#pragma mark - Query and Retrieve Ops
|
||||||
|
|
||||||
- (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock {
|
- (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock {
|
||||||
|
|
|
@ -11,10 +11,12 @@
|
||||||
@interface UIImage (CacheMemoryCost)
|
@interface UIImage (CacheMemoryCost)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The image memory cost calculation, this property would be used in memory cache of `SDImageCache`.
|
The memory cache cost for specify image used by image cache. The cost function is the pixles count held in memory.
|
||||||
* The default value is pixels of `image` or `images`.
|
If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
|
||||||
* If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
|
|
||||||
* If you set a new value after `UIImage` be cached to memory cache, you need to reinsert into cache with new value cost by yourself.
|
For `UIImage`, this method return the single frame pixles count when `image.images` is nil for static image. Retuen full frame pixels count when `image.images` is not nil for animated image.
|
||||||
|
For `NSImage`, this method return the single frame pixels count because `NSImage` does not store all frames in memory.
|
||||||
|
@note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
|
||||||
*/
|
*/
|
||||||
@property (assign, nonatomic) NSUInteger sd_memoryCost;
|
@property (assign, nonatomic) NSUInteger sd_memoryCost;
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,6 @@
|
||||||
DA248D50195472AA00390AB0 /* Frameworks */,
|
DA248D50195472AA00390AB0 /* Frameworks */,
|
||||||
DA248D51195472AA00390AB0 /* Resources */,
|
DA248D51195472AA00390AB0 /* Resources */,
|
||||||
C86216497B5A0BA9501E2C07 /* [CP] Embed Pods Frameworks */,
|
C86216497B5A0BA9501E2C07 /* [CP] Embed Pods Frameworks */,
|
||||||
85E5D3885A03BFC23B050908 /* [CP] Copy Pods Resources */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
|
@ -232,21 +231,6 @@
|
||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
85E5D3885A03BFC23B050908 /* [CP] Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "[CP] Copy Pods Resources";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
C86216497B5A0BA9501E2C07 /* [CP] Embed Pods Frameworks */ = {
|
C86216497B5A0BA9501E2C07 /* [CP] Embed Pods Frameworks */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
|
Loading…
Reference in New Issue