TZAssetModel.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // TZAssetModel.h
  3. // TZImagePickerController
  4. //
  5. // Created by 谭真 on 15/12/24.
  6. // Copyright © 2015年 谭真. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. typedef enum : NSUInteger {
  11. TZAssetModelMediaTypePhoto = 0,
  12. TZAssetModelMediaTypeLivePhoto,
  13. TZAssetModelMediaTypePhotoGif,
  14. TZAssetModelMediaTypeVideo,
  15. TZAssetModelMediaTypeAudio
  16. } TZAssetModelMediaType;
  17. @class PHAsset;
  18. @interface TZAssetModel : NSObject
  19. @property (nonatomic, strong) PHAsset *asset;
  20. @property (nonatomic, assign) BOOL isSelected; ///< The select status of a photo, default is No
  21. @property (nonatomic, assign) TZAssetModelMediaType type;
  22. @property (nonatomic, copy) NSString *timeLength;
  23. /// 是否已选过
  24. @property (nonatomic, assign) BOOL isChecked;
  25. /// Init a photo dataModel With a PHAsset
  26. /// 用一个PHAsset实例,初始化一个照片模型
  27. + (instancetype)modelWithAsset:(PHAsset *)asset type:(TZAssetModelMediaType)type;
  28. + (instancetype)modelWithAsset:(PHAsset *)asset type:(TZAssetModelMediaType)type timeLength:(NSString *)timeLength;
  29. @end
  30. @class PHFetchResult;
  31. @interface TZAlbumModel : NSObject
  32. @property (nonatomic, strong) NSString *name; ///< The album name
  33. @property (nonatomic, assign) NSInteger count; ///< Count of photos the album contain
  34. @property (nonatomic, strong) PHFetchResult *result;
  35. @property (nonatomic, strong) NSArray *models;
  36. @property (nonatomic, strong) NSArray *selectedModels;
  37. @property (nonatomic, assign) NSUInteger selectedCount;
  38. @property (nonatomic, assign) BOOL isCameraRoll;
  39. - (void)setResult:(PHFetchResult *)result needFetchAssets:(BOOL)needFetchAssets;
  40. @end