Git Product home page Git Product logo

szmichaelyb / zlphotobrowser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from longitachi/zlphotobrowser

0.0 2.0 1.0 28.57 MB

方便易用的相册照片多选框架,支持拍照、预览快速多选;相册混合选择;原图功能;在线下载iCloud端图片,且针对iCloud端图片的选择做了细节处理;自定义最大选择量及最大预览量

License: MIT License

Objective-C 99.28% Ruby 0.72%

zlphotobrowser's Introduction

ZLPhotoBrowser

###框架整体介绍

  • 该框架为一个多选照片(不支持视频)的框架,兼容设备开启的iCloud照片存储,并在加载和选择iCloud端照片时做部分细节处理。
    • 1.支持预览多选(预览图数量及最大多选数可设置)
      • [预览快速多选效果图] (#预览快速多选效果图)
    • 2.支持预览大图,大图的缩放等
      • [预览大图及缩放效果图] (#预览大图及缩放效果图)
    • 3.支持实时拍照
    • 4.支持多相册(不同的相册名字)图片混合多选
      • [相册内混合选择效果图] (#相册内混合选择效果图)
    • 5.预览已选择照片
      • [预览已选择照片效果图] (#预览已选择照片效果图)
    • 6.原图功能
      • [原图功能效果图] (#原图功能效果图)
    • 7.可实时监测相册图片变化(即在预览图时,如果用户触发截屏等操作,会实时的加载出该图片)
      • [实时监测相册内图片变化] (#实时监测相册内图片变化)
    • 8.加载iCloud端照片(所有照片加载时都会先加载模糊的图片,然后过渡高清图,iCloud端照片加载更加明显)
      • [加载iCloud端照片效果图] (#加载iCloud端照片效果图)
  • [常用Api] (#常用Api)
  • [使用方法(支持cocoapods安装)] (#使用方法)

###框架支持与框架依赖 该框架最低支持到iOS8.0,采用arc模式
需要导入Photos.framework

###注意点 如果项目中设置了

[[UINavigationBar appearance] setTranslucent:NO];

则需要在ZLDefine.h里 把kViewHeight 修改为

#define kViewHeight [[UIScreen mainScreen] bounds].size.height - 64

###常用Api

NS_ASSUME_NONNULL_BEGIN

@interface ZLPhotoActionSheet : UIView

@property (nonatomic, weak) UIViewController *sender;

@property (weak, nonatomic) IBOutlet UIButton *btnCamera;
@property (weak, nonatomic) IBOutlet UIView *baseView;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;

/** 最大选择数 default is 10 */
@property (nonatomic, assign) NSInteger maxSelectCount;

/** 预览图最大显示数 default is 20 */
@property (nonatomic, assign) NSInteger maxPreviewCount;

- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;

/**
 * @brief 显示多选照片视图
 * @param sender
 *              调用该空间的视图控制器
 * @param animate
 *              是否显示动画效果
 * @param completion
 *              完成回调
 */
- (void)showWithSender:(UIViewController *)sender animate:(BOOL)animate completion:(void (^)(NSArray<UIImage *> *selectPhotos))completion;

NS_ASSUME_NONNULL_END

@end

###使用方法

  • 直接把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.maxSelectCount = 5;
//设置预览图最大数目
actionSheet.maxPreviewCount = 20;
[actionSheet showWithSender:self animate:YES completion:^(NSArray<UIImage *> * _Nonnull selectPhotos) {
    // your codes
}];
    

预览快速多选效果图

image image

预览大图及缩放效果图

image

相册内混合选择效果图

image

预览已选择照片效果图

image

原图功能效果图

image

实时监测相册内图片变化

image

加载iCloud端照片效果图

image

zlphotobrowser's People

Contributors

longitachi avatar kkkgit avatar mouse-lin avatar

Watchers

Michael.Yang avatar  avatar

Forkers

zcgong

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.