我正試圖在swift-3中實現Google Signin,但我遇到了一個非常奇怪的錯誤,我正在關注鏈接https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift。但是我每次都會看到這個錯誤,一次又一次地實現它。 我在橋接頭中添加了以下內容。'AppDelegate'不符合協議'GIDSignInDelegate'
#import <Google/SignIn.h>
我已經安裝了吊艙GoogleSignin pod 'Google/SignIn'
這是我的AppDelegate文件代碼
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate { //<--Here it gives the error
//Method implemented but giving the error
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
//TODO
}
}
'的AppDelegate' 不符合協議 'GIDSignInDelegate'
我已經試過重新安裝莢
我有t清洗和其他的事情,但沒有注意到幫助。
我想你應該閱讀關於協議和代表。 –
您還沒有在'GIDSignInDelegate'委託中添加'didDisconnectWith'方法 –
@UmairAfzal嗯,我已經閱讀了代表和協議,並且在'didDisconnectWith'方法的前面寫了一個單詞「optional」,這意味着它不是必須的使用該方法。 @NiravD使用它沒有任何區別。 問題依然存在 –