I want to customize Google Sign-In button like below:-
I have tried below links, but none of them helped really much:-
How to customize google sign in button?
ht
Swift-5 Copy paste and Enjoy
@IBAction func btngoogle(_ sender: UIButton) {
GIDSignIn.sharedInstance().signIn()
}
//MARK:Google SignIn Delegate
func sign(inWillDispatch signIn: GIDSignIn!, error: Error!) {
// myActivityIndicator.stopAnimating()
}
// Present a view that prompts the user to sign in with Google
func sign(_ signIn: GIDSignIn!,
present viewController: UIViewController!) {
self.present(viewController, animated: true, completion: nil)
}
// Dismiss the "Sign in with Google" view
func sign(_ signIn: GIDSignIn!,
dismiss viewController: UIViewController!) {
self.dismiss(animated: true, completion: nil)
}
//completed sign In
public func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
if (error == nil) {
// Perform any operations on signed in user here.
let userId = user.userID // For client-side use only!
let idToken = user.authentication.idToken // Safe to send to the server
let fullName = user.profile.name
let givenName = user.profile.givenName
let familyName = user.profile.familyName
let email = user.profile.email
// ...
} else {
print("\(error.localizedDescription)")
}
}