Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't change custom class of UIButton to GIDSignInButton

I'm trying to add Google sign in functionality to a custom button, and I'm following this tutorial. It's telling me to select the button, and set its class as GIDSignInButton, then add this code: @IBOutlet weak var signInButton: GIDSignInButton!.

However, it doesn't let me set the class to GIDSignInButton. When I type it in and press enter, the field just clears.

enter image description here

like image 748
sinio Avatar asked Dec 24 '17 11:12

sinio


2 Answers

You should try assign GIDSignInButton not to the Button Object from the Object library but to the the View Object instead

It's work for me.

It will look like this using UIView instead of UIButton. enter image description here

like image 175
Vladimir Pertsov Avatar answered Nov 03 '22 09:11

Vladimir Pertsov


You can create UIButton and then on its action method you can write this code for signing via google:

    GIDSignIn.sharedInstance().signIn()

It works for me, in this way you can customize UIButton according to your requirement and also perform signin by using google

like image 12
H S Progr Avatar answered Nov 03 '22 09:11

H S Progr