title: Swift UI/Firebase - How to check whether the app is waiting for the Firebase Server to authenticate
body: <p>I hope that someone can help me. I have a SwiftUI Project and I use Firebase for the authentication (user login) in this app.</p>
  <p>When my app starts my code looks like this:</p>
  <pre><code>import SwiftUI
  import FirebaseAuth
  import SimpleToast
  
  struct HomeView: View {
      
      @EnvironmentObject var authModel: AuthenticationModel
      @EnvironmentObject var dashboardModel: DashboardModel
      @EnvironmentObject var gameModel: GameModel
      
      @State var userCode = &quot;&quot;
  
      var body: some View {
          
          
          
          if !authModel.loggedIn {
                  
             LaunchView()
                  .onAppear {
                      authModel.checkLogin()
                  }
              
          } else {
               
              TestView()
          }
      }
  </code></pre>
  <p>So the authModel.loggedIn is always false by default.
  And here is the code of my authModel.checkLogin() function:</p>
  <pre><code>func checkLogin() {
          
          if UserService.shared.user.name == &quot;&quot; || UserService.shared.user.name == nil  {
                  
              self.getUserInfoAfterLogin()
              
          } else {
              
              withAnimation {
                  self.loggedIn = Auth.auth().currentUser != nil ? true : false
              }
              
          }
      
          
      }
  
  </code></pre>
  <p>This is the logic for checking if the user is already logged in or not by starting the app. This works fine as well.
  The problem is when the device is in an area with a bad network connection and the app is waiting 3-4 seconds for an answer of the Firebase server there is always my LaunchView() showed.
  I want to show some kind of ProgressView instead until the answer is given but also showing the LaunchView() when the user is not logged in.
  Is there a possibility to show another view when the app is waiting for the Firebase server to authenticate?</p>