I've encounter an issue when presenting the crop controller over a Navigation controller.
When dismissing the crop controller, at the end of the transition the navigation controller view is being removed and not displayed... (happens in iPhone and iPad and only on iOS 13).
not to mention that the navigation is still there and the UI is "stuck".
@uchiaTziki Um. You might have to show me, sorry! Can you attach a screenshot?
attached screenshots...
Hope that makes things clearer..
Hmm, so you're presenting it inside another view controller getting presented?
I wonder if this dismiss code is ending up dismissing the wrong view controller then:
Can you please try changing the code in there and seeing if you can find a combination that fixes it?
Without being able to test it myself, there's nothing I can do from my end. Sorry!
I tried almost anything, but I will try again..
The controller in the back is not being dismissed.. it's view is being removed (which is weird).
Did you try these code before presenting cropViewController?
if #available(iOS 13.0, *) {
cropViewController.modalPresentationStyle = .fullScreen
}
Tried it this morning. It does solve the bug but the animation is the default modal animation (from bottom to top).
The special animation from view/frame doesn't work with this solution
@uchiaTziki did you found any fix ?
Is this reproducible in the sample app at all? If so, I can potentially have a look at it.
The way modal presentations work in iOS 13 changed from previous versions of iOS. But I haven't had a good chance to work out exactly what we need to do to update the code for that yet.
As far as I can see, it's not working properly when you have the following:
Sorry I was on vacation.
Did you try these code before presenting cropViewController?
if #available(iOS 13.0, *) { cropViewController.modalPresentationStyle = .fullScreen }
Using that (@TimOliver ) in the latest Xcode beta did the trick. So the transition animation is working for me now.
This worked for me as well.
func cropViewController(_ cropViewController: CropViewController, didFinishCancelled cancelled: Bool) {
//This code fails on iOS13.
//cropViewController.dismiss(animated: true)
let viewController = cropViewController.children.first!
viewController.modalTransitionStyle = .coverVertical
viewController.presentingViewController?.dismiss(animated: true, completion: nil)
}
This method works well on iOS 13.
I don't know why.
I expect you to find a better way.
Hi, I meet the bug on iOS 13.1
if I use
dismiss(animated: true, completion: nil)
on iOS 13.1,
All ViewController disappear.
I don't know why.
I just had to set cropViewController.modalTransitionStyle = .coverVertical
as a workaround since it then does not use the custom transition anymore...
Same thing as @oblq here.
Did you try these code before presenting cropViewController?
if #available(iOS 13.0, *) { cropViewController.modalPresentationStyle = .fullScreen }
Fixed my issue, thank you
if #available(iOS 13.0, *) {
cropViewController.modalPresentationStyle = .fullScreen
}
Thanks. This fixed my issue on iOS 13
after crop image , dismissing the crop controller, at the end of the transition the navigation controller view is being removed and not displayed
please help me out
after crop image , dismissing the crop controller, at the end of the transition the navigation controller view is being removed and not displayed
please help me out
Hi! Just set cropViewController.dismiss(animated: **false**, completion: nil)
instead of cropViewController.dismiss(animated: **true**, completion: nil)
I've been trying to solve this problem too. As @ibdman1991 says, disabling the animation works but it just looks bad. I think removing the transitioningDelegate
could be a nicer solution, not sure how impactful this would be though.
let cropViewController = CropViewController(image: image)
cropViewController.modalTransitionStyle = .crossDissolve
cropViewController.transitioningDelegate = nil
if #available(iOS 13.0, *) {
cropViewController.modalPresentationStyle = .fullScreen
}
This issue is solved in iOS 13 and above Thanks
if #available(iOS 13.0, *) {
cropViewController.modalPresentationStyle = .fullScreen
// cropViewController.modalTransitionStyle = .crossDissolve
cropViewController.transitioningDelegate = nil
}
Working for me
Uhh. Okay. Since explicitly setting the presentation style to full screen seemed to fix it for the majority of people, I'm closing this off. :)
If you have a specific use-case that requires an explicitly different modal presentation style, please open a new issue and explain very carefully what you're trying to do. Please bear in mind, if it's a bug in iOS 13, there might not be a lot we can do here.
Thanks!
Most helpful comment
This method works well on iOS 13.
I don't know why.
I expect you to find a better way.
https://www.dropbox.com/s/wyzc8errinfap1f/TestCrop.zip?dl=0