Multi-stage dialogs on iOS

Is it possible to create a multi-step set of dialogs?

In my use-case, I’m handling user authentication with an external service. Basically what I want to do is ShowModal with a LoginScreen. The LoginScreen would have an email address field and a login button. When the button is clicked the screen transitions to a VerifyScreen where the user would enter in a secret value (one-time password). Simple enough.

I can make that entire chain work, but what I can’t seem to get working is the backing out. If the verification screen fails, I want to just Close it and go back to the LoginScreen (this works fine). But if successful I want to Close it and Close the LoginScreen as well, backing out completely to the app’s main screen.

But I can’t seem to figure out a way when I call verifyScreen.ShowDialog to catch events or know when it closed, whether it was successful, etc.

Noting that one thing I’ve thought of doing is having two different iOSLayout objects: one for the main app interface and another for logging in. I think this would work just fine, but I can’t find a way to swap between layouts.

I found it finally in the documentation to modify the Content of the CurrentLayout. This solution is working for me. Hopefully this helps someone else in the future.