Open nrgbodya opened 3 years ago
Just noticed it on my app too. Only happens on ios 14 and ipad
Any suggestions to fix this?
@dani2906 as a workaround, set the modalPresentationStyle
to .popover
.
I also encountered the same problem with iPad iOS 14.4. Clicking the self toolbar Button has no other effect, it just disappears the view.
I modified the view pop-up method to solve this problem. [picker dismissViewControllerAnimated:YES completion:^{ [self presentViewController:cropController animated:YES completion:nil]; //[self.navigationController pushViewController:cropController animated:YES]; }];
I was pushing the viewController. Once changed to present modal it works fine
Hello,
In my case i also face same issue and for ipad i need to change some code to solve this issue. Here is my code. If any one face same issue try below solution.
let iPad = UIDevice.current.userInterfaceIdiom == .pad ? true : false
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
if let pickedImage = info[.originalImage] as? UIImage {
let newImage = self.resizeImage(image: pickedImage)
let cropController = CropViewController(croppingStyle: .default, image: newImage)
cropController.aspectRatioPreset = .presetSquare
cropController.aspectRatioPickerButtonHidden = true
cropController.rotateButtonsHidden = true
cropController.resetButtonHidden = true
cropController.aspectRatioLockEnabled = true
cropController.delegate = self
if iPad {
picker.dismiss(animated: true) {
self.present(cropController, animated: true, completion: nil)
}
}
else {
picker.pushViewController(cropController, animated: true)
}
}
else {
picker.dismiss(animated: true, completion: nil)
}
}
This can also be resolved by setting the modalPresentationStyle
to .fullScreen
.
same issue
resolved.
if(UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
cropController.modalPresentationStyle = UIModalPresentationFullScreen;
}
[picker dismissViewControllerAnimated:YES completion:^{
[[_window rootViewController] presentViewController:cropController animated:YES completion:nil];
}];
Describe the bug Any touch on on toolbar of CropViewController will dismiss it and any of the delegate or callback methods will be called. This happens on iPad only, and I am using CropViewController as described in "Usage". After trying to reproduce the bug in CropViewController Demo App, I wondered why it's not happening there. After studying the difference between the implementation of the Demo App and my app, I got to the conclusion that I was missing the
modalPresentationStyle = .popover
which is nowhere documented. (or am I wrong?)To Reproduce Let's take the example Demo App. Just go to the line where the
modalPresentationStyle
of theimagePicker
is set to.popover
- currently line 154 in ViewController.swift. Start the CropViewController target on iPad device. Press on plus button -> Make profile picture -> select any picture from Gallery -> when CropViewController is presented, press any button on the toolbar -> it's gone.Expected behavior Button events will be handled. i.e. press on the Done button sets the background picture in the ViewController.
iOS Device:
Additional context Interestingly enough, if you start the Split Screen mode on the iPad, this bug is not happening any more. Does is have something to do with the iPad anyway?