This is a ImagePickerController with buttons of action and collection of photos.
And the button can add beautiful icon like Snapseed used.
- Add Permisson Check
- CollectionView Realtime Refresh
Add "CDZImagePicker" files to your project
Add pod 'CDZImagePicker'
in your Podfile
- 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];
iOS中写一个仿Snapseed的ImagePickerController(照片选择器 )
iOS 8.0 Above
- Memory optimize
- Add Cocoapods
- Open a issue
- QQ:757765420
- Email:[email protected]
- Weibo:@Nemocdz
CDZImagePicker is available under the MIT license. See the LICENSE file for more info.