I am trying to implement a Twitter login in a new app I am working on using TwitterKit. Everything is working on iOS 11 and iOS 12, but there seems to be problem with iOS 13.
Here is my code in my LoginViewController
override func viewDidLoad() {
super.viewDidLoad()
let logInButton = TWTRLogInButton(logInCompletion: { session, error in
if session != nil {
UserDefaults.standard.set(session?.userID, forKey: "userId")
UserDefaults.standard.set(session?.userName, forKey: "userName")
UserDefaults.standard.set(true, forKey: "isLoggedIn")
print("***** complete with login")
self.performSegue(withIdentifier: "toHome", sender: self)
} else {
print("TWTRButton Error:")
print(error.debugDescription)
}
})
logInButton.center = self.view.center
self.view.addSubview(logInButton)
}
After logging in, the webview that logs in is supposed to dismiss, but it just spins at this current screen and does not dismiss. In fact, the loginCompletion it's self never fires, because neither of the print statements never fire.
I think it has something to do with the modal presentation. Anyway around this?
