I want to replace a view with another view using SwiftUI.
Currently I use either a NavigationView or .sheet to transition to a new view and that works fine stacking views.
However I have not found a way to completely replace a view with another view. For example when the user first lands on the App it will give an option to sign in or create a new account. I want either option to replace the previous view, not present on top of it. Another example is when the user logs out of the app. I want to dismiss my entire stack and replace with login screen. Not just dismiss all overlying views.
The analogy to pre swiftUI would be to replace the rootView.