After users successfully signing in, I want the screen to show the tab controller view automatically.
Now I finished the integrating Google Sign In part. But after signing in, the view return to the initial View Controller.
My storyboard looks like this, the blue View inside the initial View Controller is the Google Sign In button.
Below's my didSignInFor function:
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!,
withError error: Error!) {
if let error = error {
print("\(error.localizedDescription)")
} else {
//...
}
}
I know I should add codes in else{}, but still not sure how to do.
Thanks for help!

For your case first of all you need to create a class for your
UITabBarControllerwhich will confirmUITabBarControllernotUIViewControllersomething like:TabBarConrolleris your new.swiftfile. Now go to your storyboard and click on yourTabBarControllerand click on Identity Inspector and assign this newly created class to it.Next you need to initiate that class if user successfully authenticate with below code:
And one more thing you need to assign in
Storyboard IDfrom Identity Inspector which will beTabbarIdentifier.So your code will look like: