Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created November 30, 2019 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/45bb070f6b4e1452f6b9e1e07964e388 to your computer and use it in GitHub Desktop.
Save laevandus/45bb070f6b4e1452f6b9e1e07964e388 to your computer and use it in GitHub Desktop.
struct RootView: View {
@EnvironmentObject var appFlowCoordinator: AppFlowCoordinator
@ViewBuilder
var body: some View {
ZStack {
Color.black.edgesIgnoringSafeArea(.all)
if appFlowCoordinator.activeFlow == .main {
ContentView().transition(.asymmetric(insertion: .scale, removal: .opacity))
}
else if appFlowCoordinator.activeFlow == .login {
LoginView().transition(.asymmetric(insertion: .slide, removal: .opacity))
}
else {
EmptyView()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment