Skip to content

influitive/CZPhotoPickerController

 
 

Repository files navigation

CZPhotoPickerController

CZPhotoPickerController simplifies picking, taking, or using the last photo.

It presents a UIActionSheet with the appropriate options for the device, taking into account photo library permissions and whether or not the device has a camera, and then presents a UIImagePickerController (when picking an existing photo or taking a new one) or returns the last photo taken.

It supports the iPhone and iPad.

Usage:

__weak typeof(self) weakSelf = self;

photoPicker = [[CZPhotoPickerController alloc] initWithPresentingViewController:self withCompletionBlock:^(UIImagePickerController *imagePickerController, NSDictionary *imageInfoDict) {

  if (imagePickerController.allowsEditing) {
    weakSelf.imageView.image = imageInfoDict[UIImagePickerControllerEditedImage];
  }
  else {
    weakSelf.imageView.image = imageInfoDict[UIImagePickerControllerOriginalImage];
  }

  if (weakSelf.modalViewController) {
    [weakSelf dismissViewControllerAnimated:YES completion:nil];
  }

}];

photoPicker.allowsEditing = YES;

[photoPicker showFromBarButtonItem:btn];

If allowsEditing is YES, the user will be asked to resize the chosen image. Otherwise a preview is shown.

Screenshots

Action sheet

Allows editing

Credits

CZPhotoPickerController was created by Brian Cooke and Peyman Oreizy in the development of CareZone Mobile for iOS.

Contact

Brian Cooke @bricooke

Peyman Oreizy @peymano

License

CZPhotoPickerController is available under the Apache 2.0 license. See the LICENSE file for more info.

About

A photo picker offering 'use last photo taken', 'take photo', and 'choose from library'

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.0%
  • Ruby 3.0%