NYXProgressiveImageView.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // NYXProgressiveImageView.h
  3. // NYXImagesKit
  4. //
  5. // Created by @Nyx0uf on 13/01/12.
  6. // Copyright 2012 Nyx0uf. All rights reserved.
  7. // www.cocoaintheshell.com
  8. // Caching stuff by raphaelp
  9. //
  10. #import <UIKit/UIKit.h>
  11. @protocol NYXProgressiveImageViewDelegate <NSObject>
  12. @optional
  13. -(void)imageDidLoadWithImage:(UIImage*)img;
  14. -(void)imageDownloadCompletedWithImage:(UIImage*)img;
  15. -(void)imageDownloadFailedWithData:(NSData*)data;
  16. @end
  17. @interface NYXProgressiveImageView : UIImageView
  18. #pragma mark - Public messages
  19. /// Launch the image download
  20. -(void)loadImageAtURL:(NSURL*)url;
  21. /// This will remove all cached images managed by any NYXProgressiveImageView instances
  22. +(void)resetImageCache;
  23. #pragma mark - Public properties
  24. /// Delegate
  25. @property (nonatomic, weak) IBOutlet id <NYXProgressiveImageViewDelegate> delegate;
  26. /// Enable / Disable caching
  27. @property (nonatomic, getter = isCaching) BOOL caching;
  28. /// Cache time in seconds
  29. @property (nonatomic) NSTimeInterval cacheTime;
  30. /// Downloading flag
  31. @property (nonatomic, readonly, getter = isDownloading) BOOL downloading;
  32. @end