Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerController with allowsEditing doesn't allow panning to crop

Tags:

I saw this question here: UIImagePicker allowsEditing stuck in center

It seems someone had this problem before, but there's no clear resolution.

Reproduction steps:

  1. Set allowsEditing = YES
  2. Take a picture
  3. Crop window comes up, but everytime I pan the image, it just snaps back to the center.

I'm on iOS 7.0.3.

Here's my code:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

imagePicker.delegate = self;
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePicker.allowsEditing = YES;
[self presentViewController:imagePicker animated:YES completion:nil];
like image 388
chrysb Avatar asked Nov 15 '13 11:11

chrysb


1 Answers

You just need to write bellow single line of code.

UIImage *image = [info valueForKey:UIImagePickerControllerEditedImage];
like image 130
Bhavesh Kumbhani Avatar answered Oct 11 '22 00:10

Bhavesh Kumbhani