123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- #import <UIKit/UIKit.h>
- #import "DCTZAssetModel.h"
- #import "NSBundle+DCTZImagePicker.h"
- #import "DCTZImageManager.h"
- #import "DCTZVideoPlayerController.h"
- #import "DCTZGifPhotoPreviewController.h"
- #import "DCTZLocationManager.h"
- #import "DCTZPhotoPreviewController.h"
- #define iOS7Later ([UIDevice currentDevice].systemVersion.floatValue >= 7.0f)
- #define iOS8Later ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f)
- #define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f)
- #define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f)
- #define iOS11Later ([UIDevice currentDevice].systemVersion.floatValue >= 11.0f)
- @class DCTZAlbumCell, DCTZAssetCell;
- @protocol DCTZImagePickerControllerDelegate;
- @interface DCTZImagePickerController : UINavigationController
- #pragma mark -
- - (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount delegate:(id<DCTZImagePickerControllerDelegate>)delegate;
- - (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id<DCTZImagePickerControllerDelegate>)delegate;
- - (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id<DCTZImagePickerControllerDelegate>)delegate pushPhotoPickerVc:(BOOL)pushPhotoPickerVc;
- - (instancetype)initWithSelectedAssets:(NSMutableArray *)selectedAssets selectedPhotos:(NSMutableArray *)selectedPhotos index:(NSInteger)index;
- - (instancetype)initCropTypeWithAsset:(id)asset photo:(UIImage *)photo completion:(void (^)(UIImage *cropImage,id asset))completion;
- #pragma mark -
- @property (nonatomic, assign) NSInteger maxImagesCount;
- @property (nonatomic, assign) NSInteger minImagesCount;
- @property (nonatomic, assign) BOOL alwaysEnableDoneBtn;
- @property (nonatomic, assign) BOOL sortAscendingByModificationDate;
- @property (nonatomic, assign) CGFloat photoWidth;
- @property (nonatomic, assign) CGFloat photoPreviewMaxWidth;
- @property (nonatomic, assign) NSInteger timeout;
- @property (nonatomic, assign) BOOL allowPickingOriginalPhoto;
- @property (nonatomic, assign) BOOL allowPickingVideo;
- @property (nonatomic, assign) BOOL allowPickingMultipleVideo;
- @property (nonatomic, assign) BOOL allowPickingGif;
- @property(nonatomic, assign) BOOL allowPickingImage;
- @property(nonatomic, assign) BOOL allowTakePicture;
- @property(nonatomic, assign) BOOL allowTakeVideo;
- @property (assign, nonatomic) NSTimeInterval videoMaximumDuration;
- @property (nonatomic, copy) void(^uiImagePickerControllerSettingBlock)(UIImagePickerController *imagePickerController);
- @property (copy, nonatomic) NSString *preferredLanguage;
- @property (strong, nonatomic) NSBundle *languageBundle;
- @property (nonatomic, assign) BOOL allowPreview;
- @property(nonatomic, assign) BOOL autoDismiss;
- @property (assign, nonatomic) BOOL onlyReturnAsset;
- @property (assign, nonatomic) BOOL showSelectedIndex;
- @property (assign, nonatomic) BOOL showPhotoCannotSelectLayer;
- @property (strong, nonatomic) UIColor *cannotSelectLayerColor;
- @property (nonatomic, strong) NSMutableArray *selectedAssets;
- @property (nonatomic, strong) NSMutableArray<DCTZAssetModel *> *selectedModels;
- @property (nonatomic, strong) NSMutableArray *selectedAssetIds;
- - (void)addSelectedModel:(DCTZAssetModel *)model;
- - (void)removeSelectedModel:(DCTZAssetModel *)model;
- @property (nonatomic, assign) NSInteger minPhotoWidthSelectable;
- @property (nonatomic, assign) NSInteger minPhotoHeightSelectable;
- @property (nonatomic, assign) BOOL hideWhenCanNotSelect;
- @property (nonatomic, assign) BOOL isStatusBarDefault __attribute__((deprecated("Use -statusBarStyle.")));
- @property (assign, nonatomic) UIStatusBarStyle statusBarStyle;
- #pragma mark -
- @property (nonatomic, assign) BOOL showSelectBtn;
- @property (nonatomic, assign) BOOL allowCrop;
- @property (nonatomic, assign) CGRect cropRect;
- @property (nonatomic, assign) CGRect cropRectPortrait;
- @property (nonatomic, assign) CGRect cropRectLandscape;
- @property (nonatomic, assign) BOOL needCircleCrop;
- @property (nonatomic, assign) NSInteger circleCropRadius;
- @property (nonatomic, copy) void (^cropViewSettingBlock)(UIView *cropView);
- @property (nonatomic, copy) void (^navLeftBarButtonSettingBlock)(UIButton *leftButton);
- @property (nonatomic, copy) void (^photoPickerPageUIConfigBlock)(UICollectionView *collectionView, UIView *bottomToolBar, UIButton *previewButton, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel, UIView *divideLine);
- @property (nonatomic, copy) void (^photoPreviewPageUIConfigBlock)(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel);
- @property (nonatomic, copy) void (^videoPreviewPageUIConfigBlock)(UIButton *playButton, UIView *toolBar, UIButton *doneButton);
- @property (nonatomic, copy) void (^gifPreviewPageUIConfigBlock)(UIView *toolBar, UIButton *doneButton);
- @property (nonatomic, copy) void (^assetCellDidSetModelBlock)(DCTZAssetCell *cell, UIImageView *imageView, UIImageView *selectImageView, UILabel *indexLabel, UIView *bottomView, UILabel *timeLength, UIImageView *videoImgView);
- @property (nonatomic, copy) void (^albumCellDidSetModelBlock)(DCTZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel);
- @property (nonatomic, copy) void (^photoPickerPageDidLayoutSubviewsBlock)(UICollectionView *collectionView, UIView *bottomToolBar, UIButton *previewButton, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel, UIView *divideLine);
- @property (nonatomic, copy) void (^photoPreviewPageDidLayoutSubviewsBlock)(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel);
- @property (nonatomic, copy) void (^videoPreviewPageDidLayoutSubviewsBlock)(UIButton *playButton, UIView *toolBar, UIButton *doneButton);
- @property (nonatomic, copy) void (^gifPreviewPageDidLayoutSubviewsBlock)(UIView *toolBar, UIButton *doneButton);
- @property (nonatomic, copy) void (^assetCellDidLayoutSubviewsBlock)(DCTZAssetCell *cell, UIImageView *imageView, UIImageView *selectImageView, UILabel *indexLabel, UIView *bottomView, UILabel *timeLength, UIImageView *videoImgView);
- @property (nonatomic, copy) void (^albumCellDidLayoutSubviewsBlock)(DCTZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel);
- #pragma mark -
- - (id)showAlertWithTitle:(NSString *)title;
- - (void)hideAlertView:(id)alertView;
- - (void)showProgressHUD;
- - (void)showProgressHUD:(BOOL)checkTiemout;
- - (void)hideProgressHUD;
- @property (nonatomic, assign) BOOL isSelectOriginalPhoto;
- @property (assign, nonatomic) BOOL needShowStatusBar;
- #pragma mark -
- @property (nonatomic, copy) NSString *takePictureImageName __attribute__((deprecated("Use -takePictureImage.")));
- @property (nonatomic, copy) NSString *photoSelImageName __attribute__((deprecated("Use -photoSelImage.")));
- @property (nonatomic, copy) NSString *photoDefImageName __attribute__((deprecated("Use -photoDefImage.")));
- @property (nonatomic, copy) NSString *photoOriginSelImageName __attribute__((deprecated("Use -photoOriginSelImage.")));
- @property (nonatomic, copy) NSString *photoOriginDefImageName __attribute__((deprecated("Use -photoOriginDefImage.")));
- @property (nonatomic, copy) NSString *photoPreviewOriginDefImageName __attribute__((deprecated("Use -photoPreviewOriginDefImage.")));
- @property (nonatomic, copy) NSString *photoNumberIconImageName __attribute__((deprecated("Use -photoNumberIconImage.")));
- @property (nonatomic, strong) UIImage *takePictureImage;
- @property (nonatomic, strong) UIImage *photoSelImage;
- @property (nonatomic, strong) UIImage *photoDefImage;
- @property (nonatomic, strong) UIImage *photoOriginSelImage;
- @property (nonatomic, strong) UIImage *photoOriginDefImage;
- @property (nonatomic, strong) UIImage *photoPreviewOriginDefImage;
- @property (nonatomic, strong) UIImage *photoNumberIconImage;
- #pragma mark -
- @property (nonatomic, strong) UIColor *oKButtonTitleColorNormal;
- @property (nonatomic, strong) UIColor *oKButtonTitleColorDisabled;
- @property (nonatomic, strong) UIColor *naviBgColor;
- @property (nonatomic, strong) UIColor *naviTitleColor;
- @property (nonatomic, strong) UIFont *naviTitleFont;
- @property (nonatomic, strong) UIColor *barItemTextColor;
- @property (nonatomic, strong) UIFont *barItemTextFont;
- @property (nonatomic, copy) NSString *doneBtnTitleStr;
- @property (nonatomic, copy) NSString *cancelBtnTitleStr;
- @property (nonatomic, copy) NSString *previewBtnTitleStr;
- @property (nonatomic, copy) NSString *fullImageBtnTitleStr;
- @property (nonatomic, copy) NSString *settingBtnTitleStr;
- @property (nonatomic, copy) NSString *processHintStr;
- @property (strong, nonatomic) UIColor *iconThemeColor;
- #pragma mark -
- - (void)cancelButtonClick;
- @property (nonatomic, copy) void (^didFinishPickingPhotosHandle)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto);
- @property (nonatomic, copy) void (^didFinishPickingPhotosWithInfosHandle)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto,NSArray<NSDictionary *> *infos);
- @property (nonatomic, copy) void (^imagePickerControllerDidCancelHandle)(void);
- @property (nonatomic, copy) void (^didFinishPickingVideoHandle)(UIImage *coverImage,id asset);
- @property (nonatomic, copy) void (^didFinishPickingGifImageHandle)(UIImage *animatedImage,id sourceAssets);
- @property (nonatomic, weak) id<DCTZImagePickerControllerDelegate> pickerDelegate;
- @end
- @protocol DCTZImagePickerControllerDelegate <NSObject>
- @optional
- - (void)imagePickerController:(DCTZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto;
- - (void)imagePickerController:(DCTZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos;
- - (void)tz_imagePickerControllerDidCancel:(DCTZImagePickerController *)picker;
- - (void)tz_imagePickerControllerPickOverMaxCount:(DCTZImagePickerController*)picker;
- - (void)imagePickerController:(DCTZImagePickerController *)picker didFinishPickingVideo:(UIImage *)coverImage sourceAssets:(id)asset isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto;
- - (void)imagePickerController:(DCTZImagePickerController *)picker didFinishPickingGifImage:(UIImage *)animatedImage sourceAssets:(id)asset;
- - (BOOL)isAlbumCanSelect:(NSString *)albumName result:(id)result;
- - (BOOL)isAssetCanSelect:(id)asset;
- @end
- @interface DCTZAlbumPickerController : UIViewController
- @property (nonatomic, assign) NSInteger columnNumber;
- @property (assign, nonatomic) BOOL isFirstAppear;
- - (void)configTableView;
- @end
- @interface UIImage (MyBundle)
- + (UIImage *)imageNamedFromMyBundle:(NSString *)name;
- @end
- @interface NSString (TzExtension)
- - (BOOL)tz_containsString:(NSString *)string;
- - (CGSize)tz_calculateSizeWithAttributes:(NSDictionary *)attributes maxSize:(CGSize)maxSize;
- @end
- @interface DCTZCommonTools : NSObject
- + (BOOL)tz_isIPhoneX;
- + (CGFloat)tz_statusBarHeight;
- + (NSDictionary *)tz_getInfoDictionary;
- @end
- @interface DCTZImagePickerConfig : NSObject
- + (instancetype)sharedInstance;
- @property (copy, nonatomic) NSString *preferredLanguage;
- @property(nonatomic, assign) BOOL allowPickingImage;
- @property (nonatomic, assign) BOOL allowPickingVideo;
- @property (strong, nonatomic) NSBundle *languageBundle;
- @property (assign, nonatomic) NSInteger gifPreviewMaxImagesCount;
- @property (assign, nonatomic) BOOL showSelectedIndex;
- @property (assign, nonatomic) BOOL showPhotoCannotSelectLayer;
- @end
|