用户按下GIDSignInButton时回叫 [英] Call back when user presses GIDSignInButton

查看:119
本文介绍了用户按下GIDSignInButton时回叫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Google登录信息添加到我的应用程序中.我已在情节提要中添加了GIDSignInButton.当用户单击该按钮时,用户将被发送到可以登录的网页. 我想做一些检查,然后再做.在将用户定向到网页之前,有什么方法可以获取回叫方法?

I am adding Google sign-in to my app. I have added GIDSignInButton in storyboard. When user clicks on that button user is sent to webpage where he can login. I wanted to do some checks before it happens. Is there any way that I can get a call back method before user is directed to webpage?

推荐答案

您可以创建具有相同外观的任何按钮并将其挂钩到该动作

You can create any button with same look and hook it to this action

@IBOutlet func btnClicked(_ sender:UIbutton) {
    // do what you want use return if checks are failed 
    GIDSignIn.sharedInstance().signIn()
}

这篇关于用户按下GIDSignInButton时回叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆