-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathQMUIImagePickerPreviewViewController.h
More file actions
101 lines (76 loc) · 4.68 KB
/
Copy pathQMUIImagePickerPreviewViewController.h
File metadata and controls
101 lines (76 loc) · 4.68 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
/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2020 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
//
// QMUIImagePickerPreviewViewController.h
// qmui
//
// Created by QMUI Team on 15/5/3.
//
#import <UIKit/UIKit.h>
#import "QMUIImagePreviewViewController.h"
#import "QMUIAsset.h"
#import "QMUIAssetsGroup.h"
NS_ASSUME_NONNULL_BEGIN
@class QMUIButton, QMUINavigationButton;
@class QMUIImagePickerViewController;
@class QMUIImagePickerPreviewViewController;
@class QMUIAssetFetchResultChange;
@protocol QMUIImagePickerPreviewViewControllerDelegate <NSObject>
@optional
/// 取消选择图片后被调用
- (void)imagePickerPreviewViewControllerDidCancel:(QMUIImagePickerPreviewViewController *)imagePickerPreviewViewController;
/// 即将选中图片
- (void)imagePickerPreviewViewController:(QMUIImagePickerPreviewViewController *)imagePickerPreviewViewController willCheckImageAtIndex:(NSInteger)index;
/// 已经选中图片
- (void)imagePickerPreviewViewController:(QMUIImagePickerPreviewViewController *)imagePickerPreviewViewController didCheckImageAtIndex:(NSInteger)index;
/// 即将取消选中图片
- (void)imagePickerPreviewViewController:(QMUIImagePickerPreviewViewController *)imagePickerPreviewViewController willUncheckImageAtIndex:(NSInteger)index;
/// 已经取消选中图片
- (void)imagePickerPreviewViewController:(QMUIImagePickerPreviewViewController *)imagePickerPreviewViewController didUncheckImageAtIndex:(NSInteger)index;
@end
@interface QMUIImagePickerPreviewViewController : QMUIImagePreviewViewController <QMUIImagePreviewViewDelegate>
@property(nullable, nonatomic, weak) id<QMUIImagePickerPreviewViewControllerDelegate> delegate;
@property(nullable, nonatomic, strong) UIColor *toolBarBackgroundColor UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, strong) UIColor *toolBarTintColor UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, strong, readonly) UIView *topToolBarView;
@property(nullable, nonatomic, strong, readonly) QMUINavigationButton *backButton;
@property(nullable, nonatomic, strong, readonly) QMUIButton *checkboxButton;
@property(nonatomic, assign) QMUIAssetDownloadStatus downloadStatus;
/// 最多可以选择的图片数,默认为无穷大
@property(nonatomic, assign) NSUInteger maximumSelectImageCount;
/// 最少需要选择的图片数,默认为 0
@property(nonatomic, assign) NSUInteger minimumSelectImageCount;
/// 选择图片超出最大图片限制时 alertView 的标题
@property(nullable, nonatomic, copy) NSString *alertTitleWhenExceedMaxSelectImageCount;
/// 选择图片超出最大图片限制时 alertView 的标题
@property(nullable, nonatomic, copy) NSString *alertButtonTitleWhenExceedMaxSelectImageCount;
/// 已选照片,单选模式下为 nil
@property (nonatomic, strong, nullable) NSMutableArray <QMUIAsset *> *selectedImageAssetArray;
/// 照片排序方式
@property (nonatomic, assign) QMUIAlbumSortType albumSortType;
/**
* 更新数据并刷新 UI,手工调用
*
* @param imageAssetArray 包含所有需要展示的图片的数组
* @param selectedImageAssetArray 包含所有需要展示的图片中已经被选中的图片的数组
* @param currentImageIndex 当前展示的图片在 imageAssetArray 的索引
* @param singleCheckMode 是否为单选模式,如果是单选模式,则不显示 checkbox
*/
- (void)updateImagePickerPreviewViewWithAssetGroup:(QMUIAssetsGroup *)assetGroup
imagesAssets:(NSMutableDictionary <NSString *, QMUIAsset *> *)imageAssets
selectedImageAssetArray:(NSMutableArray<QMUIAsset *> * _Nullable)selectedImageAssetArray
currentImageIndex:(NSInteger)currentImageIndex
singleCheckMode:(BOOL)singleCheckMode
onlyPreviewSelectedImageAssets:(BOOL)onlyPreviewSelectedImageAssets;
- (void)updateCollectionViewWithAssetFetchResultChange:(QMUIAssetFetchResultChange *)assetFetchResultChange;
- (QMUIAsset *)imageAssetForIndex:(NSInteger)index;
@end
@interface QMUIImagePickerPreviewViewController (UIAppearance)
+ (instancetype)appearance;
@end
NS_ASSUME_NONNULL_END