UIModalTransitionStyle.partialCurl fails when dismiss(animated:) called

I'm doing a basic modal presentation from one view controller to another, with my modal presentation style set to .fullScreen and my modal transition style set to .partialCurl. When I call dismiss(animated:) on the second view controller, it starts the .partialCurl transition, but then it freezes halfway, at the point when the second view controller is deinitialized.

It happens both with the Simulator and with my iPad device. It does not happen with any of the other modal transition styles, just .partialCurl.

Any ideas what I might be doing wrong? ...

Relevant modal presentation code in the first view controller:

let vc2 = ViewController2()
vc2.modalPresentationStyle = .fullScreen 
vc2.modalTransitionStyle = .partialCurl  
present(vc2, animated: true, completion: nil)

Relevant modal presentation code in the second view controller:

dismiss(animated: true)
Answered by Claude31 in 693767022

Relevant modal presentation code in the second view controller

Where do you dismiss the second VC ?

In anycase, you should dismiss without animation:

dismiss(animated: false)
Accepted Answer

Relevant modal presentation code in the second view controller

Where do you dismiss the second VC ?

In anycase, you should dismiss without animation:

dismiss(animated: false)

But, sadly, it doesn't allow for the nice-looking transition from the second VC back to the first VC.

You're right.That is clearly a bug as noted in the SO thread I indicated. I tried by setting all transitions to full screen, to na avail.

Doc says it is possible (even though that creates many restrictions):

UIModalTransitionStyle.partialCurl

Discussion

When the view controller is presented, one corner of the current view curls up to reveal the presented view underneath. On dismissal, the curled up page unfurls itself back on top of the presented view. A view controller presented using this transition is itself prevented from presenting any additional view controllers.

This transition style is supported only if the parent view controller is presenting a full-screen view and you use the UIModalPresentationStyle.fullScreen modal presentation style. Attempting to use a different form factor for the parent view or a different presentation style triggers an exception.

You should file a bug report (at least against documentation !)

UIModalTransitionStyle.partialCurl fails when dismiss(animated:) called
 
 
Q