2016-10-28 2 views
3

이제 Google 로그인을 구현하려고합니다. 나는 다음과 같이 다음 : https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift스위프트 3 : AppDelegate가 GIDSignInDelegate 프로토콜을 따르지 않습니다.

하지만 AppDelegate.swift에서 오류가 발생했습니다 :

class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate 
.... 

오류 :

'AppDelegate에이'GIDSignInDelegate '

프로토콜을 준수하지 않는 유형

도와주세요.

+0

@Anish 웃음 : 답장을 보내 주셔서 감사합니다. 하지만 이미 설정했지만이 오류가 발생합니다. –

답변

26

AppDelegateGIDSignInDelegate의 두 가지 방법을 구현해야합니다.

func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) { 

} 

func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) { 

} 
+0

답변 해 주셔서 감사합니다. 오류가 사라집니다! –

+2

위대한 작품, 구글의 문서에서 대리자를 사용하지만 그들은 업데이 트되지 않았습니다, 아마도 구글도 자신의 문서를 업데이 트해야합니다. 고마워요 동생 :) –

관련 문제