ZLPhotoTool.h
1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// ZLPhotoTool.h
// 多选相册照片
//
// Created by long on 15/11/30.
// Copyright © 2015年 long. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Photos/Photos.h>
@interface ZLPhotoAblumList : NSObject
@property (nonatomic, copy) NSString *title; //相册名字
@property (nonatomic, assign) NSInteger count; //该相册内相片数量
@property (nonatomic, strong) PHAsset *headImageAsset; //相册第一张图片缩略图
@property (nonatomic, strong) PHAssetCollection *assetCollection; //相册集,通过该属性获取该相册集下所有照片
@end
@interface ZLPhotoTool : NSObject
+ (instancetype)sharePhotoTool;
/**
* @brief 获取用户所有相册列表
*/
- (NSArray<ZLPhotoAblumList *> *)getPhotoAblumList;
/**
* @brief 获取相册内所有图片资源
* @param ascending 是否按创建时间正序排列 YES,创建时间正(升)序排列; NO,创建时间倒(降)序排列
*/
- (NSArray<PHAsset *> *)getAllAssetInPhotoAblumWithAscending:(BOOL)ascending;
/**
* @brief 获取指定相册内的所有图片
*/
- (NSArray<PHAsset *> *)getAssetsInAssetCollection:(PHAssetCollection *)assetCollection ascending:(BOOL)ascending;
/**
* @brief 获取每个Asset对应的图片
*/
- (void)requestImageForAsset:(PHAsset *)asset size:(CGSize)size resizeMode:(PHImageRequestOptionsResizeMode)resizeMode completion:(void (^)(UIImage *image))completion;
@end