Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios GIDSignInButton需要点击两个手指才能启动Google登录流_Ios_Swift_Google Signin_Gidsignin - Fatal编程技术网

Ios GIDSignInButton需要点击两个手指才能启动Google登录流

Ios GIDSignInButton需要点击两个手指才能启动Google登录流,ios,swift,google-signin,gidsignin,Ios,Swift,Google Signin,Gidsignin,我正在我的应用程序中实现Google的SignIn SDK,当一切正常时,GIDSignButton需要用两个手指点击才能启动OAuth流 以下是所有相关代码: 在AppDelegate.swift中 func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { return GIDSignIn.sharedInstance().handleURL(

我正在我的应用程序中实现Google的SignIn SDK,当一切正常时,GIDSignButton需要用两个手指点击才能启动OAuth流

以下是所有相关代码:

AppDelegate.swift中

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
    return GIDSignIn.sharedInstance().handleURL(url, sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String, annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
}

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    return GIDSignIn.sharedInstance().handleURL(url, sourceApplication: sourceApplication, annotation: annotation)
}
let googleLoginButton: GIDSignInButton = {
    let button = GIDSignInButton()
    button.colorScheme = .Light
    button.style = .IconOnly
    return button
}()

override func viewDidLoad() {
    super.viewDidLoad()

     var configureError: NSError?
    GGLContext.sharedInstance().configureWithError(&configureError)
    assert(configureError == nil, "Error configuring with Google services: \(configureError)")

    GIDSignIn.sharedInstance().delegate = self
    GIDSignIn.sharedInstance().uiDelegate = self

    view.addSubview(googleLoginButton)
}

func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!, withError error: NSError!) {
    if (error == nil) {
        // Success
    } else {
       // Failure
    }

}
LoginViewController.swift中

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
    return GIDSignIn.sharedInstance().handleURL(url, sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String, annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
}

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    return GIDSignIn.sharedInstance().handleURL(url, sourceApplication: sourceApplication, annotation: annotation)
}
let googleLoginButton: GIDSignInButton = {
    let button = GIDSignInButton()
    button.colorScheme = .Light
    button.style = .IconOnly
    return button
}()

override func viewDidLoad() {
    super.viewDidLoad()

     var configureError: NSError?
    GGLContext.sharedInstance().configureWithError(&configureError)
    assert(configureError == nil, "Error configuring with Google services: \(configureError)")

    GIDSignIn.sharedInstance().delegate = self
    GIDSignIn.sharedInstance().uiDelegate = self

    view.addSubview(googleLoginButton)
}

func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!, withError error: NSError!) {
    if (error == nil) {
        // Success
    } else {
       // Failure
    }

}

同样,实际的谷歌登录工作,但按钮需要两个手指点击工作。如何使其像普通按钮一样工作(只需要一个手指)?

我有一个类似的问题,在我的案例中,是主视图中的点击手势识别器导致了问题,将识别器的
取消触摸视图设置为false解决了问题我有一个类似的问题,在我的例子中,是主视图中的点击手势识别器导致了问题,将识别器的
取消触摸视图设置为false解决了问题