My app has three screens: an Intro, a Main, and Calculator. Calculator is presented modally from Main. When dismissing Calculator, I want to return to Main. Instead, Calculator is dismissed and then Main is also dismissed automatically, returning the user to Intro.
I've tried using different presentation types and changing the Intro view controller to have a custom class (it originally used the same type as Main).
This is my exit function in Calculator:
@IBAction func exitCalculator(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
I'm hoping to use the exit function to dismiss Calculator but not Main. I've attached a screenshot of the interface builder to show the organization of the screens.