@jbap It's better to switch them inside a container. That means that there is always a window, it is never dismissed. With your solution, the user waits for the UI to close and reopen.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.