Created
November 11, 2011 19:12
-
-
Save jamztang/1358918 to your computer and use it in GitHub Desktop.
UIImage downloader spec using proxy placeholder. Anyone in favor of this idea?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@protocol JTImageProxy <NSObject> | |
- (NSURL *)URL; | |
- (CGFloat)expectedSize; | |
- (CGFloat)totalDownloadedSize; | |
- (CGFloat)progress; | |
- (NSError *)error; | |
- (void)cancelDownload; | |
- (void)restartDownload; | |
@end | |
@interface JTImageProxy : NSProxy <JTImageProxy> | |
@property (nonatomic, strong) NSURL *URL; | |
@property (nonatomic, strong) UIImage *image; | |
+ (JTImageProxy *)proxyWithURL:(NSURL *)URL; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@class JTImageProxy; | |
@interface UIImage (JTImageProxy) | |
+ (UIImage <JTImageProxy> *)imageWithURL:(NSURL *)URL; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@class JTImageProxy; | |
@interface UIImage (JTImageProxy) | |
+ (UIImage <JTImageProxy> *)imageWithURL:(NSURL *)URL; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment