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?
https://developers.google.com/identity/sign-in/ios/
Could somebody please guide what I should do? I can't use Google+ Sign-In button because "Google+ Sign-In is deprecated".
Edited:- I tried the code provided on below link:-
https://developers.google.com/identity/sign-in/ios/sign-in#add_the_sign-in_button
Try this for swift, its very simple and works like a champ.
Create reference for your Google Sign In button
@IBOutlet weak var signInButton: GIDSignInButton!
set style for it in viewDidLoad
3.Place your custom button above the google sign in button in main story board and create an action reference for it. Inside it click the google sign in button programmatically.
You can add your own button instead of using Google Sign-In button Do follwing things
Objective C Version
1)Add your own button into storyBoard
2)drag action into viewController
3)handle delegate methods
#pragma mark - Google SignIn Delegate
// Present a view that prompts the user to sign in with Google
// Dismiss the "Sign in with Google" view
//completed sign In
Swift 4 Version
In Swift make sure you have added briding header as the library is written in objective C
1)Add your own button into storyBoard
2)drag action into viewController
3)handle delegate methods
//MARK:Google SignIn Delegate
// Present a view that prompts the user to sign in with Google
// Dismiss the "Sign in with Google" view
//completed sign In
Edit: Here is the reference/evidence for usage of custom button, Google Doc reference
For Swift 4.2
to make a custom Google button :
1-add your button to storyboard
2-create @IBaction for your button
3-follow instructions on https://developers.google.com/identity/sign-in/ios/sign-in but replace this step
"2 .In the view controller, override the viewDidLoad method to set the UI delegate of the GIDSignIn object, and (optionally) to sign in silently when possible"
with
-> insert this code in the button action
now you can happily customize your button,hope this answer help you.
Swift 3 Version
In Swift make sure you have added briding header as the library is written in objective C.
drag action into viewController
handle delegate methods
You can add your own button instead of using Google Sign-In button Do follwing things
1)Add this code in AppDelegate.m file
2)Add your own button into storyBoard and give class name as GPPSignInButton and set UIImageView on that button.
3)drag action into viewController
AppDelegate.m file
For Swift 4: (This is working code Enjoy)