title: Swift google sign in
body: <p>i'm trying to add the Google signIn in my app (with firebase) and i can get a successfully access but i don't know how i can change the viewController after this</p>
  
  <pre><code>import UIKit
  import FirebaseAuth
  import FBSDKCoreKit
  import FBSDKLoginKit
  import GoogleSignIn
  
  class FirstClass: UIViewController , FBSDKLoginButtonDelegate, GIDSignInUIDelegate {
  
  
      @IBOutlet weak var FirstClass: UIView!
      @IBOutlet weak var signButton: UIButton!
      @IBOutlet weak var lButton: UIButton!
      @IBOutlet weak var customSegmented: CustomSegmentedControl!
  
  
      let loginButton = FBSDKLoginButton()
  
  
  /*  let credential = FacebookAuthProvider.credential(withAccessToken: FBSDKAccessToken.current().tokenString) */
  
  
  
  
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
         /* GIDSignIn.sharedInstance().uiDelegate = self
          GIDSignIn.sharedInstance().signIn()  */
  
          setupGoogleButtons()
  
          loginButton.readPermissions = ["public_profile", "email", "user_friends"]
          loginButton.frame = CGRect(x: 67, y: 536, width: 118, height: 41 )
          loginButton.delegate = self
          self.view.addSubview(loginButton)
      }
  
  
  
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  
  
  
  
  
      override func viewDidAppear(_ animated: Bool) {
  
          if Auth.auth().currentUser != nil {
              self.performSegue(withIdentifier: "goToHome1", sender: self)
          }
  
      }
  
  
  
      fileprivate func setupGoogleButtons() {
  
          let googleButton = GIDSignInButton()
          googleButton.frame = CGRect(x: 189, y: 536, width: 118, height: 41)
          view.addSubview(googleButton)
  
          GIDSignIn.sharedInstance().uiDelegate = self
  }
  
  
  
  
  
      func handleCustomGoogleSign() {
          GIDSignIn.sharedInstance().signIn()
  }
  
  
  
  
  
  
  
  
  
  
  
      func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) {
  
          if let error = error {
              print("Failed to log into Google: ", error)
              return
          }
          print("Successfully logged into Google", user)
  
          guard let idToken = user.authentication.idToken else { return }
          guard let accessToken = user.authentication.accessToken else { return }
          let credentials = GoogleAuthProvider.credential(withIDToken: idToken, accessToken: accessToken)
  
          Auth.auth().signIn(with: credentials, completion: { (user, error) in
              if let err = error {
                  print("Failed to create a Firebase User with Google account: ", err)
                  return
              }
  
              guard let uid = user?.uid else { return }
  
              print("Successfully logged into Firebase with Google", uid)
          })
      }
  </code></pre>
  
  <p>here is the relevant part of the viewController's code where the google signIn button is. Where i've to add the "perform segue" to change the view after a successfully log in ?</p>