Open takep2 opened 5 years ago
I found the workaround for this issue.
CLImageEditor0.2.4 works fine with modal screen transition.
So, when we transit from UIImagePickerController to CLImageEditor, instead of a push transition using pushViewController, modal screen transition using presentViewController, all the subsequent operations will work well.
Specifically, in the ViewController.m file of CLImageEditorDemo project,
change the code in the didFinishPickingMediaWithInfo
method from pushViewController
to presentViewController
as follows.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
CLImageEditor *editor = [[CLImageEditor alloc] initWithImage:image];
editor.delegate = self;
// [picker pushViewController:editor animated:YES];
[picker presentViewController:editor animated:YES completion:nil];
}
Then, instead of closing CLImageEditor in the didFinishEditingWithImage method, close UIImagePickerController by specifying self as follows.
- (void)imageEditor:(CLImageEditor *)editor didFinishEditingWithImage:(UIImage *)image
{
_imageView.image = image;
[self refreshImageView];
// [editor dismissViewControllerAnimated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];
}
In addition to that, adding the implementation of the imageEditorDidCancel method as follows can avoid the issue of #97.
- (void)imageEditorDidCancel:(CLImageEditor *)editor
{
[self dismissViewControllerAnimated:YES completion:nil];
}
Steps to reproduce.
Then navigation bar dives into the status bar. So I can't tap Back button or OK button.
This occurs from 0.2.4. There is no problem with 0.2.3.