Giter Club home page Giter Club logo

cdzimagepicker's Introduction

CDZImagePicker

This is a ImagePickerController with buttons of action and collection of photos.

And the button can add beautiful icon like Snapseed used.

Demo Preview

ImagePickerDemo2

Changelog

  • Add Permisson Check
  • CollectionView Realtime Refresh

Installation

Manual

Add "CDZImagePicker" files to your project

CocoaPods

Add pod 'CDZImagePicker' in your Podfile

Usage

  • Use default style
#import "CDZImagePickerViewController.h"
 CDZImagePickerViewController *imagePickerController = [[CDZImagePickerViewController alloc]init];
[imagePickerController openPickerInController:self withImageBlock:^(UIImage *image) {
        if (image) { //if image has changed
           self.imageView.image = image;//your code
        }
        [self.backgroundView removeFromSuperview];//your code
    }];
  • Use in iOS10

    Open "Info.plist" file in your project and add

<key>NSCameraUsageDescription</key>    
<string>cameraDesciption</string>

<key>NSPhotoLibraryUsageDescription</key>    
<string>cameraDesciption</string>
  • Change style of action button
#import "CDZImagePickerActionsItem.h"

​ And init the actionArray with CDZImagePickerActionItem with title, action, image and order you want.

imagePickerController.actionArray = [NSMutableArray arrayWithObjects:  		[[CDZImagePickerActionsItem alloc]initWithTitle:@"打开设备上的图片" withActionType:CDZImagePickerLibraryAction withImage:[UIImage imageNamed:@"phone-icon.png"]],
[[CDZImagePickerActionsItem alloc]initWithTitle:@"相机" withActionType:CDZImagePickerCameraAction withImage:[UIImage imageNamed:@"camera-icon.png"]]
 [[CDZImagePickerActionsItem alloc]initWithTitle:@"打开最新图片" withActionType:CDZImagePickerRecentAction withImage:[UIImage imageNamed:@"clock-icon.png"]],  nil];

Articles

iOS中写一个仿Snapseed的ImagePickerController(照片选择器 )

iOS中权限封装小tips和监测相册变化

Requirements

iOS 8.0 Above

TODO

  • Memory optimize
  • Add Cocoapods

Contact

License

CDZImagePicker is available under the MIT license. See the LICENSE file for more info.

cdzimagepicker's People

Contributors

nemocdz avatar

Watchers

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