Closed komaldaudia closed 8 years ago
If the editor is used with UIImagePickerController, try
- (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];
}
Thank you @yackle for the quick help, it worked. :)
I want to popup alert before cancelling the image editing , but i am anable to track the method and also optional delegate method is not calling "imageEditorDidCancel", i have set the delegate too, Kindly revert ASAP.
thank you in advance