54 lines
1.8 KiB
Objective-C
54 lines
1.8 KiB
Objective-C
//
|
|
// TZAssetModel.h
|
|
// TZImagePickerController
|
|
//
|
|
// Created by 谭真 on 15/12/24.
|
|
// Copyright © 2015年 谭真. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <UIKit/UIKit.h>
|
|
|
|
typedef enum : NSUInteger {
|
|
DCTZAssetModelMediaTypePhoto = 0,
|
|
DCTZAssetModelMediaTypeLivePhoto,
|
|
DCTZAssetModelMediaTypePhotoGif,
|
|
DCTZAssetModelMediaTypeVideo,
|
|
DCTZAssetModelMediaTypeAudio
|
|
} DCTZAssetModelMediaType;
|
|
|
|
@class PHAsset;
|
|
@interface DCTZAssetModel : NSObject
|
|
|
|
@property (nonatomic, strong) id asset; ///< PHAsset or ALAsset
|
|
@property (nonatomic, assign) BOOL isSelected; ///< The select status of a photo, default is No
|
|
@property (nonatomic, assign) DCTZAssetModelMediaType type;
|
|
@property (assign, nonatomic) BOOL needOscillatoryAnimation;
|
|
@property (nonatomic, copy) NSString *timeLength;
|
|
@property (strong, nonatomic) UIImage *cachedImage;
|
|
|
|
/// Init a photo dataModel With a asset
|
|
/// 用一个PHAsset/ALAsset实例,初始化一个照片模型
|
|
+ (instancetype)modelWithAsset:(id)asset type:(DCTZAssetModelMediaType)type;
|
|
+ (instancetype)modelWithAsset:(id)asset type:(DCTZAssetModelMediaType)type timeLength:(NSString *)timeLength;
|
|
|
|
@end
|
|
|
|
|
|
@class PHFetchResult;
|
|
@interface DCTZAlbumModel : NSObject
|
|
|
|
@property (nonatomic, strong) NSString *name; ///< The album name
|
|
@property (nonatomic, assign) NSInteger count; ///< Count of photos the album contain
|
|
@property (nonatomic, strong) id result; ///< PHFetchResult<PHAsset> or ALAssetsGroup<ALAsset>
|
|
|
|
@property (nonatomic, strong) NSArray *models;
|
|
@property (nonatomic, strong) NSArray *selectedModels;
|
|
@property (nonatomic, assign) NSUInteger selectedCount;
|
|
|
|
@property (nonatomic, assign) BOOL isCameraRoll;
|
|
|
|
- (void)setResult:(id)result needFetchAssets:(BOOL)needFetchAssets;
|
|
|
|
@end
|