UIImagePickerController AllowsEditing not working

后端 未结 6 1693
余生分开走
余生分开走 2020-12-05 11:02

I am using UIImagePickerController to allow the user to take a picture. I want to allow him/her to edit it afterwards but, whatever I do, I get nothing.

Here is my co

6条回答
  •  醉话见心
    2020-12-05 11:37

    When using UIImagePickerController's delegate method - imagePickerController:didFinishPickingMediaWithInfo:, we get the image using

    UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
    

    This code will always return the original image, even if editing is ON.

    Try using

    UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
    

    This will return the edited image if editing is ON.

    Hope this helps.

提交回复
热议问题