Unfortunately I have not found a way.

I tried using the @SceneBuilder property to build a multi-scene view, but it doesn't work with if-else (for example, if user has not clicked a template, show the template view).

Generally, I think switching scenes isn't a good idea. They were meant to contain individual lifecycles, which doesn't make sense for document editing (why would you have one lifecycle for the template view and another for the document editor?).

However, I have noticed other questions similar to yours, and a solution may eventually be found.



Remember that SwiftUI 2 is still in beta and that new functionality is being added constantly.

I like reading manga and writing about Swift. Check out my app, Find — look for text in real life, with outrageous speed. getfind.app

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store