我們在很多場景都有可能用到TZImagePickerController,下面我為它封裝多一層,這樣我們便可以更簡單地使用他!
先提供一個連接
HBTZImagePickerHelper
下面介紹一下的封裝代碼:
//聲明類型
typedef NS_ENUM(NSInteger,HBManageSelectTakeType) {
HBManageSelectTakePhotoType,//選擇拍照得到圖片
HBManageSelectTakeShootingVideoType,//選擇拍照視頻
HBManageSelectTakeVideoType,//直接選擇視頻
HBManageSelectTakeImagePickerType//直接獲取圖片
};
設(shè)置代理,設(shè)置代理方法,用于選擇圖片或者視頻時候的回調(diào)
///選擇圖片回調(diào)
-(void)selectTZImagePickerSelectedPhotos:(NSMutableArray *)selectedPhotos withSelectedAssets:(NSMutableArray *)selectAssets andIsOriginalPoto:(BOOL)isSelectOriginalPhoto andBlockData:(NSData *)data outPutPath:(NSString *)outPutPath withSelectTakeType:(HBManageSelectTakeType )selectType;
HBTZImagePickerHelper的使用方法:
/**打開手機圖片庫
@param maxCount 最大張數(shù)
@param superController superController
@param selectType selectType
*/
- (void)showImagePickerControllerWithMaxCount:(NSInteger )maxCount WithViewController: (UIViewController *)superController withSelectTakeType:(HBManageSelectTakeType )selectType withAssetsArr:(NSMutableArray *)CusSelectedAssets andPhotosArr:(NSMutableArray *)CusSelectedPhotos;
其他方法看代碼便可!
分享之路上有你的一個贊,我便有無窮的動力,代碼文字粗糙,謝謝你的閱讀!
END.