yackle / CLImageEditor

MIT License
2.22k stars 574 forks source link

Bug in iOS 8 when take a picture from camera. #97

Open abmgames opened 9 years ago

abmgames commented 9 years ago

Hello, First of all thanks for this amazing library

We faced an issue in iOS 8 when we take a picture from camera -> Navigate (pushViewController) with image to CLIMageEditor -> back to camera

Seems like the camera freeze (with a blur image layer) Is this a iOS bug or something with CLIMageEditor library? iOS 7 work fine

Please help

yackle commented 9 years ago

Looks like there was a design change in the interior of the image picker. I still don't find a way to completely fix it. It seems that we need to dismiss the picker, and the following code can be used as a hot fix.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if([navigationController isKindOfClass:[UIImagePickerController class]] && [viewController isKindOfClass:[CLImageEditor class]]){
        viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonDidPush:)];
    }
}

- (void)cancelButtonDidPush:(id)sender
{
    [self.presentedViewController dismissViewControllerAnimated:YES completion:nil];
}
mooms commented 9 years ago

Hi

I also encounter this problem. Thanks for your hot fix but it loses the capability for a user to retake the picture or re-select picture from the library.

Look forward to your updates on this issue!

wira commented 8 years ago

Hi, thanks for amazing library

Problem also occur when you navigate from picker controller that has allowsEditing = true

aliexalter commented 7 years ago

Swift 3 code `func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) { if((navigationController .isKind(of: UIImagePickerController.self)) && (viewController .isKind(of: CLImageEditor.self))) { viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action:#selector(AddNewFavLocationVC.cancelButtonDidPush)) } }

func cancelButtonDidPush()
{
        self.presentedViewController?.dismiss(animated: true, completion: nil)
}`