IDMPhoto.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // IDMPhoto.h
  3. // IDMPhotoBrowser
  4. //
  5. // Created by Michael Waterfall on 17/10/2010.
  6. // Copyright 2010 d3i. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "IDMPhotoProtocol.h"
  10. #import <SDWebImage/SDWebImageManager.h>
  11. // This class models a photo/image and it's caption
  12. // If you want to handle photos, caching, decompression
  13. // yourself then you can simply ensure your custom data model
  14. // conforms to IDMPhotoProtocol
  15. @interface IDMPhoto : NSObject <IDMPhoto>
  16. // Progress download block, used to update the circularView
  17. typedef void (^IDMProgressUpdateBlock)(CGFloat progress);
  18. // Properties
  19. @property (nonatomic, strong) NSString *caption;
  20. @property (nonatomic, strong) NSURL *photoURL;
  21. @property (nonatomic, strong) IDMProgressUpdateBlock progressUpdateBlock;
  22. @property (nonatomic, strong) UIImage *placeholderImage;
  23. // Class
  24. + (IDMPhoto *)photoWithImage:(UIImage *)image;
  25. + (IDMPhoto *)photoWithFilePath:(NSString *)path;
  26. + (IDMPhoto *)photoWithURL:(NSURL *)url;
  27. + (NSArray *)photosWithImages:(NSArray *)imagesArray;
  28. + (NSArray *)photosWithFilePaths:(NSArray *)pathsArray;
  29. + (NSArray *)photosWithURLs:(NSArray *)urlsArray;
  30. // Init
  31. - (id)initWithImage:(UIImage *)image;
  32. - (id)initWithFilePath:(NSString *)path;
  33. - (id)initWithURL:(NSURL *)url;
  34. @end