GithubHelp home page GithubHelp logo

xhphoto's Introduction

XHPhoto

  • 一行代码搞定照片选择,支持相册/相机及设置是否裁剪

AppVeyor Version Status Support Pod Platform Pod License

技术交流群(群号:537476189).

效果

image

使用方法

导入UIViewController+XHPhoto.h头文件,在控制器中调用

1.使用系统UIActionSheet来选择打开相机、相册

    //edit:照片需要裁剪:传YES,不需要裁剪传NO(默认NO)
    [self showCanEdit:YES photo:^(UIImage *photo) {
        
    //TO TO...
        
    }];

2.直接打开相机

    //edit:照片需要裁剪:传YES,不需要裁剪传NO(默认NO)
    [self showCameraCanEdit:YES photo:^(UIImage *photo) {
        
		//TO TO...
		
    }];

3.直接打开相册

    //edit:照片需要裁剪:传YES,不需要裁剪传NO(默认NO)
    [self showPhotoLibraryCanEdit:YES photo:^(UIImage *photo) {
        
		//TO TO...
		
    }];

注意

  • 请在info.plist中添加
  • Privacy - Photo Library Usage Description
  • Privacy - Camera Usage Description

Tips

  • 将Info.plist Localization native development region 值 设置 china 相册及相机界面即显示为中文

安装

手动添加:

  • 1.将 XHPhoto 文件夹添加到工程目录中
  • 2.导入 UIViewController+XHPhoto.h.h

CocoaPods:

  • 1.在 Podfile 中添加 pod 'XHPhoto'
  • 2.执行 pod install 或 pod update
  • 3.导入 UIViewController+XHPhoto.h.h

Tips

  • 1.如果发现pod search XHLaunchAd 搜索出来的不是最新版本,需要在终端执行cd ~/desktop退回到desktop,然后执行pod setup命令更新本地spec缓存(需要几分钟),然后再搜索就可以了
  • 2.如果你发现你执行pod install后,导入的不是最新版本,请删除Podfile.lock文件,在执行一次 pod install
  • 3.如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的代码看看BUG修复没有)

系统要求

  • 该项目最低支持 iOS 7.0 和 Xcode 7.0

许可证

XHPhoto 使用 MIT 许可证,详情见 LICENSE 文件

xhphoto's People

Contributors

coderzhuxh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xhphoto's Issues

ipad上如何使用呢

提示如下:
Warning: Attempt to present <UIImagePickerController: 0x7fbb6181a400> on <MyselfDataViewController: 0x7fbb62930200> which is already presenting (null)

点击取消按钮没有反应

加上以下代码可以解决

  • (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
    {
    [picker dismissViewControllerAnimated:YES completion:^{}];
    }

能否加入title

sheet有一个title属性,能否在调用sheet的时候把title暴露出来,这样可以做部分定制化。

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.