Firebase - Applying Log Out Function

I am trying to implement a logout button in my application using swift. Users are authenticated through firebase. This is the function that I am currently working on:

 @IBAction func buttonLogOut(_ sender: Any) {
     
     do
    {
      try Auth.auth().signOut()
      let storyboard = UIStoryboard(name: "Main", bundle: nil)
      let loginVC = storyboard.instantiateViewController(withIdentifier: "login View Controller") as! loginVC
      let appDelegate = UIApplication.shared.delegate as! AppDelegate
      appDelegate.window?.rootViewController = loginVC
      self.performSegue(withIdentifier: "Dashboard", sender: self)
    }
    catch let error as NSError
    {
      print(error.localizedDescription)
    }
     
     
  }
    
     
  }

I am getting these errors on the following lines and Im unsure how to solve this

let loginVC = storyboard.instantiateViewController(withIdentifier: "loginViewController") as! Main

Cannot find type 'Main' in scope

And

appDelegate.window?.rootViewController = loginVC

Value of type 'AppDelegate' has no member 'window'

This is not an Apple product & I recommend you ask any Google related API questions over at google here in one of their discussion options: https://firebase.google.com/community

Firebase - Applying Log Out Function
 
 
Q