财神随手记账

MWPhoto.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // MWPhoto.h
  3. // MWPhotoBrowser
  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 <Photos/Photos.h>
  10. #import "MWPhotoProtocol.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 MWPhotoProtocol
  15. @interface MWPhoto : NSObject <MWPhoto>
  16. @property (nonatomic, strong) NSString *caption;
  17. @property (nonatomic, strong) NSURL *videoURL;
  18. @property (nonatomic) BOOL emptyImage;
  19. @property (nonatomic) BOOL isVideo;
  20. + (MWPhoto *)photoWithImage:(UIImage *)image;
  21. + (MWPhoto *)photoWithURL:(NSURL *)url;
  22. + (MWPhoto *)photoWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize;
  23. + (MWPhoto *)videoWithURL:(NSURL *)url; // Initialise video with no poster image
  24. - (id)init;
  25. - (id)initWithImage:(UIImage *)image;
  26. - (id)initWithURL:(NSURL *)url;
  27. - (id)initWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize;
  28. - (id)initWithVideoURL:(NSURL *)url;
  29. @end