CDZImagePicker
CDZImagePicker copied to clipboard
仿 Snapseed 的照片浏览器
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
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(照片选择器 )
Requirements
iOS 8.0 Above
TODO
- Memory optimize
Contact
- Open a issue
- QQ:757765420
- Email:[email protected]
- Weibo:@Nemocdz
License
CDZImagePicker is available under the MIT license. See the LICENSE file for more info.