Created
January 4, 2022 20:33
-
-
Save mitnick78/9051e3c7b2eb8db31aeedbf2398913fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State var isActive = false | |
@EnvironmentObject var viewModel: AuthViewModel | |
var body: some View { | |
VStack { | |
if isActive { | |
if viewModel.userSession == nil { | |
Login() | |
} else { | |
Home() | |
} | |
} else { | |
SplashScreen() | |
} | |
}.onAppear { | |
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) { | |
withAnimation { | |
self.isActive = true | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment