Code Monkey home page Code Monkey logo

qicuili / zlphotobrowser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from longitachi/zlphotobrowser

0.0 1.0 0.0 42.49 MB

方便易用的相册多选框架,支持预览/相册内拍照、预览快速多选相片,单选gif及video;相册混合选择;原图功能;支持多语言国际化(中文简/繁,英语,日语);在线下载iCloud端图片,且针对iCloud端图片的选择做了细节处理;自定义最大选择量及最大预览量

License: MIT License

Objective-C 99.60% Ruby 0.40%

zlphotobrowser's Introduction

ZLPhotoBrowser

Version License Platform Language

框架整体介绍

框架支持与框架依赖

  • iOS8.0
    • (采用arc模式)
  • XCode8.0
    • (需要导入Photos.framework)

常用Api

/**
 显示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 image image image

预览快速多选效果图

image image

直接进入相册选择相片效果图

image

预览大图及缩放效果图

image image image

拍照

image

相册内混合选择效果图

image image

预览已选择照片效果图

image image

原图功能效果图

image

zlphotobrowser's People

Contributors

longitachi avatar kkkgit avatar mouse-lin avatar

Watchers

qicuili avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.