Created
March 17, 2015 20:14
-
-
Save ianbarber/08c6f56df3f5882ab9ad to your computer and use it in GitHub Desktop.
ViewController for GIDSignIn example
This file contains 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
class ViewController: UIViewController, GIDSignInDelegate { | |
@IBOutlet weak var signInButton: GIDSignInButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
GIDSignIn.sharedInstance().delegate = self | |
// Test to see if we are signed in on load. | |
GIDSignIn.sharedInstance().signInSilently() | |
} | |
func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!, withError error: NSError!) { | |
if (error == nil) { | |
signInButton.hidden = true; | |
println("Signed in!") | |
} else { | |
println("\(error.localizedDescription)") | |
} | |
} | |
func signIn(signIn: GIDSignIn!, didDisconnectWithUser user: GIDGoogleUser!, withError error: NSError!) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment