Giter Club home page Giter Club logo

hxweibophotopicker's Introduction

HXWeiboPhotoPicker - 仿微博照片选择器

一. 更新历史

  • 2017-03-07 解决通过相机拍照时照片旋转90°的问题
  • 2017-03-08 解决拍照之后,在浏览大图时选中图片,列表界面Cell没有选中的问题

二. 特性

  • 查看/选择GIF图片
  • 照片、视频可同时多选/原图
  • 3DTouch预览照片
  • 长按拖动改变顺序
  • 自定义相机拍照/录制视频
  • 自定义转场动画

三. 安装

  • 手动导入:将项目中的“HXWeiboPhotoPicker”文件夹拖入项目中
  • 只使用照片选择功能 导入头文件 "HXPhotoViewController.h"
  • 选完照片/视频后自动布局功能 导入头文件 "HXPhotoView.h"

四.  要求

  • iOS8及以上系统可使用. ARC环境.
  • 在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要配置两个info.plist文件。                                             Privacy - Photo Library Usage Description 和 Privacy - Camera Usage Description。

五. 例子

  • Demo1
// 懒加载 照片管理类
- (HXPhotoManager *)manager
{
    if (!_manager) {
        _manager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypePhotoAndVideo];
    }
    return _manager;
}

// 照片选择控制器
HXPhotoViewController *vc = [[HXPhotoViewController alloc] init];
vc.delegate = self;
vc.manager = self.manager; 
[self presentViewController:[[UINavigationController alloc] initWithRootViewController:vc] animated:YES completion:nil];

// 通过 HXPhotoViewControllerDelegate 代理返回选择的图片以及视频
- (void)photoViewControllerDidNext:(NSArray *)allList Photos:(NSArray *)photos Videos:(NSArray *)videos Original:(BOOL)original

// 点击取消
- (void)photoViewControllerDidCancel
  • Demo2
// 懒加载 照片管理类
- (HXPhotoManager *)manager
{
    if (!_manager) {
        _manager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypePhotoAndVideo];
    }
    return _manager;
}

self.navigationController.navigationBar.translucent = NO;
self.automaticallyAdjustsScrollViewInsets = YES;

HXPhotoView *photoView = [[HXPhotoView alloc] initWithFrame:CGRectMake((414 - 375) / 2, 100, 375, 400) WithManager:self.manager];
photoView.delegate = self;
photoView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:photoView];

// 通过 HXPhotoViewDelegate 代理返回 选择、移动顺序、删除之后的图片以及视频
- (void)photoViewChangeComplete:(NSArray *)allList Photos:(NSArray *)photos Videos:(NSArray *)videos Original:(BOOL)isOriginal

// 当 HXPhotoView 更新frame改变大小时
- (void)photoViewUpdateFrame:(CGRect)frame WithView:(UIView *)view

六. 更多

  • 如果您发现了bug请尽可能详细地描述系统版本、手机型号和复现步骤等信息 提一个issue.

  • 如果您有什么好的建议也可以提issue,大家一起讨论一起学习进步...

  • 具体代码看请下载项目 如果觉得喜欢的能给一颗小星星么!  ✨✨✨

  • QQ : 294005139点击这里给我发消息

  • 有兴趣可以加下刚刚创建的QQ群:531895229

hxweibophotopicker's People

Contributors

silencelove avatar

Watchers

James Cloos avatar freeJuice 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.