Skip to content

Instantly share code, notes, and snippets.

@mitnick78
Created January 4, 2022 20:33
Show Gist options
  • Save mitnick78/9051e3c7b2eb8db31aeedbf2398913fb to your computer and use it in GitHub Desktop.
Save mitnick78/9051e3c7b2eb8db31aeedbf2398913fb to your computer and use it in GitHub Desktop.
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