![Language](https://camo.githubusercontent.com/ec9dc34a327d0e6f00b223398287e6591e60b28d405f61774128043c12f1020d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c616e67756167652d2532304f626a656374697665253230432532302d626c75652e737667)
- 该框架为一个多选照片(支持视频、gif)的框架,兼容设备开启的iCloud照片存储,支持记录历史选择照片。
- 1.支持多语言国际化(中:简繁, 英,日)
- 2.支持预览多选(预览图数量及最大多选数可设置)
- 3.支持直接进入相册多选
- 4.支持预览大图,大图的缩放等(预览视频、gif)
- 5.支持预览界面和相册内实时拍照
- 6.支持多相册图片混合多选
- 7.预览已选择照片
- 8.原图功能
- 常用Api
- 使用方法(支持cocoapods安装)
/**
显示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;
/**
提供 预览用户已选择的照片(非gif与video类型),并可以取消已选择的照片
@param photos 已选择的uiimage照片数组
@param assets 已选择的phasset照片数组
@param index 点击的照片索引
*/
- (void)previewSelectedPhotos:(NSArray<UIImage *> *)photos assets:(NSArray<PHAsset *> *)assets index:(NSInteger)index;
- 直接把PhotoBrowser文件夹拖入到您的工程中
- Cocoapods安装
pod search ZLPhotoBrowser
- 在项目plist配置文件中添加如下键,值并设为YES
Localized resources can be mixed YES
//或者右键plist文件Open As->Source Code 添加
<key>CFBundleAllowMixedLocalizations</key>
<true/>
#import "ZLPhotoActionSheet.h"
ZLPhotoActionSheet *actionSheet = [[ZLPhotoActionSheet alloc] init];
//设置照片最大预览数
actionSheet.maxPreviewCount = 20;
//设置照片最大选择数
actionSheet.maxSelectCount = 10;
actionSheet.sender = self;
[actionSheet setSelectImageBlock:^(NSArray<UIImage *> * _Nonnull images, NSArray<PHAsset *> * _Nonnull assets, BOOL isOriginal) {
//your codes
}];
[actionSheet setSelectGifBlock:^(UIImage * _Nonnull gif, PHAsset * _Nonnull asset) {
//your codes
}];
[actionSheet setSelectVideoBlock:^(UIImage * _Nonnull coverImage, PHAsset * _Nonnull asset) {
//your codes
}];
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/zh-hant.png)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E9%A2%84%E8%A7%88%E5%A4%A7%E5%9B%BE%E5%BF%AB%E9%80%9F%E9%80%89%E6%8B%A9.gif)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E7%9B%B4%E6%8E%A5%E8%BF%9B%E5%85%A5%E7%9B%B8%E5%86%8C%E9%80%89%E6%8B%A9%E7%9B%B8%E7%89%87.gif)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E9%A2%84%E8%A7%88%E9%80%89%E6%8B%A9%E8%A7%86%E9%A2%91.gif)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E7%9B%B8%E5%86%8C%E5%86%85%E9%83%A8%E6%8B%8D%E7%85%A7.gif)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E4%B8%8D%E8%83%BD%E5%90%8C%E6%97%B6%E9%80%89%E6%8B%A9%E7%85%A7%E7%89%87%E5%92%8Cgif%E6%88%96video.gif)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E9%A2%84%E8%A7%88%E7%A1%AE%E5%AE%9A%E9%80%89%E6%8B%A9%E7%9A%84%E7%85%A7%E7%89%87.gif)
![image](https://github.com/longitachi/ZLPhotoBrowser/raw/master/%E6%95%88%E6%9E%9C%E5%9B%BE/%E5%8E%9F%E5%9B%BE%E5%8A%9F%E8%83%BD.gif)