I am using a firebase based application, in which I would like to skip the login page if the user is already logged in. My application initially starts on the login page, so here is my code to segue immediately if the user is already logged in.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if FIRAuth.auth()?.currentUser != nil {
DispatchQueue.main.async {
self.performSegue(withIdentifier: self.loginSegue, sender: nil)
}
}
}
This works as intended, HOWEVER, for a SPLIT SECOND, you can see the login page before it segues properly. My segue has its animation off, and I would like the main VC to be presented without the sign in being seen on screen at all.