Created
June 11, 2009 23:41
-
-
Save jfricker/128319 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // | |
| // AsyncImageView.h | |
| // | |
| #import <UIKit/UIKit.h> | |
| @class JFDataCache; | |
| @interface AsyncCachedImageView : UIView { | |
| //could instead be a subclass of UIImageView instead of UIView, depending on what other features you want to | |
| // to build into this class? | |
| NSURL *urlImg; // for the cache | |
| NSString *_defaultImageName; // placeholder for images | |
| NSURLConnection *connection; //keep a reference to the connection so we can cancel download in dealloc | |
| NSMutableData *data; //keep reference to the data so we can collect it as it downloads | |
| NSInteger httpStatus; | |
| JFDataCache *cache; | |
| } | |
| - (void)loadImageFromURL:(NSURL*)url; | |
| - (void)loadImageFromURL:(NSURL*)url withDefault:(NSString *)defaultImageName; | |
| - (void)loadImageFromData:(NSData *)dataImage; | |
| - (void)displayDefaultImage; | |
| - (void)removeDefaultImage; | |
| - (void)displayImage; | |
| - (UIImage*) image; | |
| - (void) stopAnimation; | |
| - (void) startAnimation; | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment