谷歌登录iOS应用程序而不使用UIViewController作为代理

谷歌登录iOS应用程序而不使用UIViewController作为代理,ios,google-plus,google-signin,gidsignin,Ios,Google Plus,Google Signin,Gidsignin,我们可以在不将UIViewcontroller设置为代理的情况下使用Google登录吗?我在GooglePlus API中也做过同样的事情,它现在似乎不起作用,抛出异常 ***由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因是:“uiDelegate必须是| UIViewController |或实现| signIn:presentViewController:|和| signIn:dismissViewController:|来自| GIDSignI

我们可以在不将UIViewcontroller设置为代理的情况下使用Google登录吗?我在GooglePlus API中也做过同样的事情,它现在似乎不起作用,抛出异常

***由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因是:“uiDelegate必须是| UIViewController |或实现| signIn:presentViewController:|和| signIn:dismissViewController:|来自| GIDSignInUIDelegate |的方法。”

由于许多屏幕依赖于GoogleSignin,我创建了GoogleManagerSingleton类并抽象了所有signIn逻辑,而不是在任何地方添加signIn代码。一旦使用访问令牌成功登录,此类将进行回调。当我使用GooglePlus API时,我是这样设置委托的

signIn = [GPPSignIn sharedInstance];
        signIn.shouldFetchGoogleUserEmail = YES; // adds scope for "https://www.googleapis.com/auth/userinfo.email"
        signIn.shouldFetchGooglePlusUser = YES; // adds scope for "https://www.googleapis.com/auth/plus.me"
        signIn.clientID = kClientId;
        signIn.scopes = @[@"https://www.googleapis.com/auth/plus.login", @"profile", @"https://www.googleapis.com/auth/user.birthday.read"];
        signIn.delegate = self;
        signIn.attemptSSO = true;
正如预期的那样,现在我已经迁移到google signIn,因为google plus sign已被弃用

gSignIn = [GIDSignIn sharedInstance];
gSignIn.shouldFetchBasicProfile = YES;
gSignIn.clientID = kClientId;
gSignIn.scopes = @[ @"profile", @"email" ];
gSignIn.delegate = self;
gSignIn.uiDelegate = self;
[gSignIn signIn];
它不允许我将单例类设置为委托,在运行时它抛出上述异常

是否可以在Google signIn中将NSObject类设置为委托?或者有解决办法吗