QMUIImagePickerViewController
@interface QMUIImagePickerViewController : QMUICommonViewController <UICollectionViewDataSource, UICollectionViewDelegate, QMUIImagePickerPreviewViewControllerDelegate>
@property(nullable, nonatomic, weak) id<QMUIImagePickerViewControllerDelegate> imagePickerViewControllerDelegate;
/*
* 图片的最小尺寸,布局时如果有剩余空间,会将空间分配给图片大小,所以最终显示出来的大小不一定等于minimumImageWidth。默认是75。
* @warning collectionViewLayout 和 collectionView 可能有设置 sectionInsets 和 contentInsets,所以设置几行不可以简单的通过 screenWdith / columnCount 来获得
*/
@property(nonatomic, assign) CGFloat minimumImageWidth UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, strong, readonly) UICollectionViewFlowLayout *collectionViewLayout;
@property(nullable, nonatomic, strong, readonly) UICollectionView *collectionView;
@property(nullable, nonatomic, strong, readonly) UIView *operationToolBarView;
@property(nullable, nonatomic, strong, readonly) QMUIButton *previewButton;
@property(nullable, nonatomic, strong, readonly) QMUIButton *sendButton;
@property(nullable, nonatomic, strong, readonly) UILabel *imageCountLabel;
/// 也可以直接传入 QMUIAssetsGroup,然后读取其中的 QMUIAsset 并储存到 imagesAssetArray 中,传入后会赋值到 QMUIAssetsGroup,并自动刷新 UI 展示
- (void)refreshWithAssetsGroup:(QMUIAssetsGroup * _Nullable)assetsGroup;
@property(nullable, nonatomic, strong, readonly) NSMutableArray<QMUIAsset *> *imagesAssetArray;
@property(nullable, nonatomic, strong, readonly) QMUIAssetsGroup *assetsGroup;
/// 当前被选择的图片对应的 QMUIAsset 对象数组
@property(nullable, nonatomic, strong, readonly) NSMutableArray<QMUIAsset *> *selectedImageAssetArray;
/// 是否允许图片多选,默认为 YES。如果为 NO,则不显示 checkbox 和底部工具栏。
@property(nonatomic, assign) BOOL allowsMultipleSelection;
/// 最多可以选择的图片数,默认为无符号整形数的最大值,相当于没有限制
@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;
/**
* 加载相册列表时会出现 loading,若需要自定义 loading 的形式,可将该属性置为 NO,默认为 YES。
* @see imagePickerViewControllerWillStartLoading: & imagePickerViewControllerDidFinishLoading:
*/
@property(nonatomic, assign) BOOL shouldShowDefaultLoadingView;
@end
Undocumented
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, weak) id<QMUIImagePickerViewControllerDelegate> imagePickerViewControllerDelegate
Swift
weak var imagePickerViewControllerDelegate: QMUIImagePickerViewControllerDelegate? { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat minimumImageWidth
Swift
var minimumImageWidth: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) UICollectionViewFlowLayout *collectionViewLayout
Swift
var collectionViewLayout: UICollectionViewFlowLayout? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) UICollectionView *collectionView
Swift
var collectionView: UICollectionView? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) UIView *operationToolBarView
Swift
var operationToolBarView: UIView? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) QMUIButton *previewButton
Swift
var previewButton: QMUIButton? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) QMUIButton *sendButton
Swift
var sendButton: QMUIButton? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) UILabel *imageCountLabel
Swift
var imageCountLabel: UILabel? { get }
-
也可以直接传入 QMUIAssetsGroup,然后读取其中的 QMUIAsset 并储存到 imagesAssetArray 中,传入后会赋值到 QMUIAssetsGroup,并自动刷新 UI 展示
Declaration
Objective-C
- (void)refreshWithAssetsGroup:(id)assetsGroup;
Swift
func refresh(withAssetsGroup assetsGroup: Any!)
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) NSMutableArray<QMUIAsset *> *imagesAssetArray
Swift
var imagesAssetArray: NSMutableArray? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) QMUIAssetsGroup *assetsGroup
Swift
var assetsGroup: UnsafeMutablePointer<Int32>? { get }
-
当前被选择的图片对应的 QMUIAsset 对象数组
Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) NSMutableArray *selectedImageAssetArray;
Swift
var selectedImageAssetArray: NSMutableArray? { get }
-
是否允许图片多选,默认为 YES。如果为 NO,则不显示 checkbox 和底部工具栏。
Declaration
Objective-C
@property (nonatomic) BOOL allowsMultipleSelection;
Swift
var allowsMultipleSelection: Bool { get set }
-
最多可以选择的图片数,默认为无符号整形数的最大值,相当于没有限制
Declaration
Objective-C
@property (nonatomic) NSUInteger maximumSelectImageCount;
Swift
var maximumSelectImageCount: UInt { get set }
-
最少需要选择的图片数,默认为 0
Declaration
Objective-C
@property (nonatomic) NSUInteger minimumSelectImageCount;
Swift
var minimumSelectImageCount: UInt { get set }
-
选择图片超出最大图片限制时 alertView 的标题
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *alertTitleWhenExceedMaxSelectImageCount;
Swift
var alertTitleWhenExceedMaxSelectImageCount: String? { get set }
-
选择图片超出最大图片限制时 alertView 底部按钮的标题
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *alertButtonTitleWhenExceedMaxSelectImageCount;
Swift
var alertButtonTitleWhenExceedMaxSelectImageCount: String? { get set }
-
加载相册列表时会出现 loading,若需要自定义 loading 的形式,可将该属性置为 NO,默认为 YES。
See
imagePickerViewControllerWillStartLoading: & imagePickerViewControllerDidFinishLoading:Declaration
Objective-C
@property (nonatomic) BOOL shouldShowDefaultLoadingView;
Swift
var shouldShowDefaultLoadingView: Bool { get set }
-
Undocumented
Declaration
Objective-C
+ (instancetype)appearance;
Swift
class func appearance() -> Self