I have successfully implemented Firebase pre-built UI. It includes providers for google, facebook, email, and phone. Launching the app brings you to a viewController with a login button. Clicking the button brings up the `authUIController`. After signing in to one of the providers, the `authUIController` disappears and I'm brought back to the original `viewController` with the login button. How do I transition to a new `viewController` after authentication. I am sure its stupid simple and Im over looking something. Please help.

I have tried using `present(viewController(), animation: true, completion: nil)` and `performSegue(withIdentifier: "goHome", sender: nil)` in several different places of my code. I moved my provider's array from `viewDidLoad()` to `viewDidAppear()` and nothing. I don't know what to do here. I have searched Google's documentation, YouTube and stack overflow with no luck. I know that I should only submit snippets of my code, but I am so lost as to what I should show I have pasted the `viewControllers` code.

```
import UIKit
import Firebase
import FirebaseAuth
import FirebaseUI
import FirebaseDatabase
import FacebookCore
import FacebookLogin
import FBSDKLoginKit
import FacebookShare
import GoogleSignIn

class LoginViewController: UIViewController, FUIAuthDelegate,
GIDSignInUIDelegate, FBSDKLoginButtonDelegate {

    @IBAction func loginAction(sender: AnyObject) {
        // Present the default login view controller provided by authUI
        let authViewController = authUI?.authViewController();
        self.present(authViewController!, animated: true, completion: nil)
    }

    let loginButton = FBSDKLoginButton()

    fileprivate(set) var auth:Auth?
    fileprivate(set) var authUI: FUIAuth? //only set internally but get externally
    fileprivate(set) var authStateListenerHandle: AuthStateDidChangeListenerHandle?

    override func viewDidLoad() {
        super.viewDidLoad()

        if let accessToken = AccessToken.current {
            // User is logged in, use 'accessToken' here.
        }

        GIDSignIn.sharedInstance().uiDelegate = self
        GIDSignIn.sharedInstance().signIn()

        self.authStateListenerHandle = self.auth?.addStateDidChangeListener { (auth, user) in
            if user != nil {(self.performSegue(withIdentifier: "goHome", sender: nil))
            } else {
                self.loginAction(sender: self)
                return
            }
        }
    }

    override func viewDidAppear(_ animated: Bool) {
        let providers: [FUIAuthProvider] = [
            FUIEmailAuth(),
            FUIGoogleAuth(),
            FUIFacebookAuth(),
            FUIPhoneAuth(authUI: FUIAuth.defaultAuthUI()!),
            ]
        //loginButton.delegate = self

        // Do any additional setup after loading the view, typically from a nib.
        self.auth = Auth.auth()
        self.authUI = FUIAuth.defaultAuthUI()
        self.authUI?.delegate = self
        self.authUI?.providers = providers
    }

    func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
        if let error = error {
            print(error.localizedDescription)
            return
        }
        let credential = FacebookAuthProvider.credential(withAccessToken: FBSDKAccessToken.current().tokenString)

        Auth.auth().signInAndRetrieveData(with: credential) { (authResult, error) in
            if let error = error {
                // ...
                return
            }
            // User is signed in
            // ...
        }
    }

    func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
        print("User Logged Out")
    }

    func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) {
        // ...
        if let error = error {
            // ...
            return
        }

        guard let authentication = user.authentication else { return }
        let credential = GoogleAuthProvider.credential(withIDToken: authentication.idToken,
                                                       accessToken: authentication.accessToken)
        Auth.auth().signInAndRetrieveData(with: credential) { (authResult, error) in
            if let error = error {
                // ...
                return
            }
        }
    }

    // Implement the required protocol method for FIRAuthUIDelegate

    func authUI(_ authUI: FUIAuth, didSignInWith user: User?, error: Error?) {
        guard let authError = error else { return }

        let errorCode = UInt((authError as NSError).code)

        switch errorCode {
        case FUIAuthErrorCode.userCancelledSignIn.rawValue:
            print("User cancelled sign-in");
            break

        default:
            let detailedError = (authError as NSError).userInfo[NSUnderlyingErrorKey] ?? authError
            print("Login error: \((detailedError as! NSError).localizedDescription)");
        }
    }
}

```