PFLogInViewControllerDelegate functions not called

54 Views Asked by At

When using PFLogInViewController (or a subclass of it), it looks like none of the functions inside PFLogInViewControllerDelegate are ever called. Eventhough the main ViewController declares to conform to the PFLogInViewControllerDelegate protocol and the delegate for the PFLogInViewController object is set.

Is there something else to do ?

Here is the relevant code, though I don't think it will bring more than what is written above:

class ViewController: UIViewController, PFLogInViewControllerDelegate {
    var loginVC:PFLogInViewController!
    ....
    func someFunc() {
        if (loginVC == nil) {
            loginVC = PFLogInViewController()
            loginVC.delegate = self
        }

        self.navigationController?.pushViewController(loginVC, animated: true)
    }
    ....
    // MARK: - PFLogInViewControllerDelegate

    // Sent to the delegate to determine whether the log in request should be submitted to the server.
    func logInViewController(logInController: PFLogInViewController,
                             shouldBeginLogInWithUsername username:String,
                             password: String) -> Bool {
        print(#function) // THIS IS NEVER CALLED!!!

        return true
    }


    // Sent to the delegate when a PFUser is logged in.
    func logInViewController(logInController: PFLogInViewController, didLogInUser user: PFUser) {
        print(#function) // THIS IS NEVER CALLED!!!
    }
}
0

There are 0 best solutions below