[英]How can I use Facebook login in my app and move to next page/view controller after successfully logIn?
当我按继续按钮而不是看到“退出按钮”和同一页面时,我想在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)
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.