我想在我的 iOS 应用程序中使用 Facebook 登录后,当我按下继续按钮而不是看到“注销按钮”和同一页面时转到下一页/视图控制器。我该怎么做?
我尝试在这里添加 segue
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
if error != nil {
print(error)
return
}
performSegue(withIdentifier: "segueVC", sender: nil)
print("sucessfully logged in with FB")
}
但它没有用。非常感谢!
尝试在主线程中调用 performSegue
class ViewController:UIViewController {
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
if error != nil {
print(error)
return
}
DispatchQueue.main.async {
performSegue(withIdentifier: "segueVC", sender: nil)
}
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句