forked from jakemarsh/JMImageCache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JMImageCache.h
45 lines (31 loc) · 1.36 KB
/
JMImageCache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// JMImageCache.h
// JMCache
//
// Created by Jake Marsh on 2/7/11.
// Copyright 2011 Jake Marsh. All rights reserved.
//
#import "UIImageView+JMImageCache.h"
@class JMImageCache;
@protocol JMImageCacheDelegate <NSObject>
@optional
- (void) cache:(JMImageCache *)c didDownloadImage:(UIImage *)i forURL:(NSURL *)url;
- (void) cache:(JMImageCache *)c didDownloadImage:(UIImage *)i forURL:(NSURL *)url key:(NSString*)key;
@end
@interface JMImageCache : NSCache
+ (JMImageCache *) sharedCache;
- (void) imageForURL:(NSURL *)url key:(NSString *)key completionBlock:(void (^)(UIImage *image))completion;
- (void) imageForURL:(NSURL *)url completionBlock:(void (^)(UIImage *image))completion;
- (UIImage *) cachedImageForKey:(NSString *)key;
- (UIImage *) cachedImageForURL:(NSURL *)url;
- (UIImage *) imageForURL:(NSURL *)url key:(NSString*)key delegate:(id<JMImageCacheDelegate>)d;
- (UIImage *) imageForURL:(NSURL *)url delegate:(id<JMImageCacheDelegate>)d;
- (UIImage *) imageFromDiskForKey:(NSString *)key;
- (UIImage *) imageFromDiskForURL:(NSURL *)url;
- (void) setImage:(UIImage *)i forKey:(NSString *)key;
- (void) setImage:(UIImage *)i forURL:(NSURL *)url;
- (void) removeImageForKey:(NSString *)key;
- (void) removeImageForURL:(NSString *)url;
- (void) writeData:(NSData *)data toPath:(NSString *)path;
- (void) performDiskWriteOperation:(NSInvocation *)invoction;
@end