Fixed styling to match rs/SDWebImage repo

This commit is contained in:
Don 2013-09-12 13:45:11 -07:00
parent 547345c7f5
commit 8a2ae7e547
2 changed files with 8 additions and 5 deletions

View File

@ -62,7 +62,8 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
_diskCachePath = [paths[0] stringByAppendingPathComponent:fullNamespace];
dispatch_sync(_ioQueue, ^{
dispatch_sync(_ioQueue, ^
{
_fileManager = NSFileManager.new;
});
@ -190,10 +191,11 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
[self storeImage:image imageData:nil forKey:key toDisk:toDisk];
}
- (BOOL)diskImageExistsWithKey:(NSString *)key {
- (BOOL)diskImageExistsWithKey:(NSString *)key
{
__block BOOL exists = NO;
dispatch_sync(_ioQueue, ^{
dispatch_sync(_ioQueue, ^
{
exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key]];
});

View File

@ -66,7 +66,8 @@
}
}
- (BOOL)diskImageExistsForURL:(NSURL *)url {
- (BOOL)diskImageExistsForURL:(NSURL *)url
{
NSString *key = [self cacheKeyForURL:url];
return [self.imageCache diskImageExistsWithKey:key];
}