0

Within my root UIViewController I call up a submenu, second UIViewController, with the following code:

within root UIViewController

let myInvMenu = InvMenuCtrl()
myInvMenu.modalPresentationStyle = .fullScreen
myInvMenu.modalTransitionStyle = .partialCurl
present(myInvMenu, animated: false)

Within the new screen, I have a back button, I want dismiss it, and return to the original UIViewController.

dismiss(animated: false) 

In this post, I have the animation set to false, because that works fine. But if I set it to true, I crash on the dismissal.

From the docs, below I assumed that I didn't have to handle anything myself, but obviously if someone could tell me where my misunderstanding is:

The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, UIKit asks the presenting view controller to handle the dismissal.

1 Answers1

0

Looks like the .modalTransitionStyle = .partialCurl is malfunctioning for some time if used for poresenting and dismissing of UIViewController Try This Answer to make the same presentation using containment of UIViews or create yourself custom UIPresentationController with custom animation that mimics .partialCurl transition. Hopefully you will find right solution that fits you.

Mr.SwiftOak
  • 1,469
  • 3
  • 8
  • 19
  • I was trying to avoid extra coding, but if that's what does it, will come back and mark your answer correct. Might be better as well, I've seen posts similar to mine, and in some, it crashes "sporadically" which is scarier than always crashing. Thanks. – oldprogrammer84 Mar 18 '22 at 16:56
  • You were correct in one thing, that I never thought of, replacing .partialCurl. The others appear to work as well. I wonder if it's safe to just use a different modalTransitionStyle? – oldprogrammer84 Mar 18 '22 at 17:01
  • @MrSwiftOak Am also going to cross pos (an edited version) t this on Apple Developer forums to see if anyone is familiar with any bugs – oldprogrammer84 Mar 18 '22 at 17:11
  • 1
    Sure, sometimes an extra coding is worth it.. – Mr.SwiftOak Mar 20 '22 at 19:36
  • 1
    @MrSwiftOak Actually decided to still with the built in one line animation. Better to make my app complete first, then work on bells and whistles. – oldprogrammer84 Mar 23 '22 at 18:06