Last active
December 31, 2018 06:55
-
-
Save kgleong/183d64eff4677255e7eeea9f6efc8b68 to your computer and use it in GitHub Desktop.
Google Sign In - View Controller - Configure GIDSignIn singleton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import GoogleSignIn | |
| class ViewController: UIViewController { | |
| // ... | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| /***** Configure Google Sign In *****/ | |
| GIDSignIn.sharedInstance()?.delegate = self | |
| // GIDSignIn.sharedInstance()?.signIn() will throw an exception if not set. | |
| GIDSignIn.sharedInstance()?.uiDelegate = self | |
| // Attempt to renew a previously authenticated session without forcing the | |
| // user to go through the OAuth authentication flow. | |
| // Will notify GIDSignInDelegate of results via sign(_:didSignInFor:withError:) | |
| GIDSignIn.sharedInstance()?.signInSilently() | |
| // ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment