ZLPhotoActionSheet.h
2.96 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//
// ZLPhotoActionSheet.h
// 多选相册照片
//
// Created by long on 15/11/25.
// Copyright © 2015年 long. All rights reserved.
//
//pods version 2.6.3 - 2018.01.09 update
#import <UIKit/UIKit.h>
#import "ZLPhotoConfiguration.h"
NS_ASSUME_NONNULL_BEGIN
@class ZLPhotoModel;
@class PHAsset;
@interface ZLPhotoActionSheet : UIView
@property (nonatomic, weak) UIViewController *sender;
/**相册框架配置,默认为 [ZLPhotoConfiguration defaultPhotoConfiguration]*/
@property (nonatomic, strong, readonly) ZLPhotoConfiguration *configuration;
/**
已选择的asset对象数组,用于标记已选择的图片
*/
@property (nonatomic, strong, nullable) NSMutableArray<PHAsset *> *arrSelectedAssets;
/**
选择照片回调,回调解析好的图片、对应的asset对象、是否原图
pod 2.2.6版本之后 统一通过selectImageBlock回调
*/
@property (nonatomic, copy) void (^selectImageBlock)(NSArray<UIImage *> *__nullable images, NSArray<PHAsset *> *assets, BOOL isOriginal);
/**
取消选择回调
*/
@property (nonatomic, copy) void (^cancleBlock)(void);
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
/**
显示ZLPhotoActionSheet选择照片视图
@warning 需提前赋值 sender 对象
@param animate 是否显示动画效果
*/
- (void)showPreviewAnimated:(BOOL)animate;
/**
显示ZLPhotoActionSheet选择照片视图
@param animate 是否显示动画效果
@param sender 调用该对象的控制器
*/
- (void)showPreviewAnimated:(BOOL)animate sender:(UIViewController *)sender;
/**
直接进入相册选择界面
*/
- (void)showPhotoLibrary;
/**
直接进入相册选择界面
@param sender 调用该对象的控制器
*/
- (void)showPhotoLibraryWithSender:(UIViewController *)sender;
/**
提供 预览用户已选择的照片,并可以取消已选择的照片 (需先设置 sender 参数)
@param photos 已选择的uiimage照片数组
@param assets 已选择的phasset照片数组
@param index 点击的照片索引
@param isOriginal 是否为原图
*/
- (void)previewSelectedPhotos:(NSArray<UIImage *> *)photos assets:(NSArray<PHAsset *> *)assets index:(NSInteger)index isOriginal:(BOOL)isOriginal;
/**
提供 混合预览照片及视频的方法, 相册PHAsset / 网络、本地图片 / 网络、本地视频,(需先设置 sender 参数)
@warning 由于 NSURL 框架内需要区分是图片还是视频,所以url后缀为 jpg/png/jpeg/gif 等格式按照图片处理,后缀在以上四种之外的NSURL对象均按视频处理
@param photos 接收对象 PHAsset / UIImage / NSURL(网络图片/视频url 或 本地图片/视频url)
@param index 点击的照片/视频索引
@param hideToolBar 是否隐藏底部工具栏和导航右上角选择按钮
@param complete 回调 (数组内为接收的 PHAsset / UIImage / NSURL 对象)
*/
- (void)previewPhotos:(NSArray *)photos index:(NSInteger)index hideToolBar:(BOOL)hideToolBar complete:(void (^)(NSArray *photos))complete;
NS_ASSUME_NONNULL_END
@end