在我的 iOS 应用程序中使用 Facebook 登录后,当我按下“继续”按钮时,我想转到下一页/ View Controller ,而不是看到“注销按钮”和同一页面。我该怎么做?
我尝试在这里添加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)
}
}
}
关于ios - 如何在我的应用程序中使用 Facebook 登录并在成功登录后移至下一个页面/ View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49477755/