Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation bar dives into the status bar when pushed from UIImagePickerController #220

Open
takep2 opened this issue Nov 16, 2018 · 1 comment

Comments

@takep2
Copy link

takep2 commented Nov 16, 2018

Steps to reproduce.

  1. Download CLImageEditor-0.2.4.zip
  2. Open Demo/CLIMageEditorDemo/CLImageEditorDemo.xcodeproj
  3. Run on iPhone X Simulator
  4. Tap 'New' button on Tabbar
  5. Select 'Photo Library' on ActionSheet
  6. Select photo on UIImagePickerController
  7. Select toolbar button (e.g. Filter button) on CLImagEditor screen

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.

@takep2
Copy link
Author

takep2 commented Jul 3, 2019

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];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant