PFLogInViewControllerDelegate

@protocol PFLogInViewControllerDelegate <NSObject>

The PFLogInViewControllerDelegate protocol defines methods a delegate of a PFLogInViewController should implement. All methods of this protocol are optional.

  • Sent to the delegate to determine whether the log in request should be submitted to the server.

    Declaration

    Objective-C

    - (BOOL)logInViewController:(nonnull PFLogInViewController *)logInController
        shouldBeginLogInWithUsername:(nonnull NSString *)username
                            password:(nonnull NSString *)password;

    Parameters

    logInController

    The login view controller that is requesting the data.

    username

    the username the user tries to log in with.

    password

    the password the user tries to log in with.

    Return Value

    A BOOL indicating whether the log in should proceed.

  • Sent to the delegate when a PFUser is logged in.

    Declaration

    Objective-C

    - (void)logInViewController:(nonnull PFLogInViewController *)logInController
                   didLogInUser:(nonnull PFUser *)user;

    Parameters

    logInController

    The login view controller where login finished.

    user

    PFUser object that is a result of the login.

  • Sent to the delegate when the log in attempt fails.

    If you implement this method, PFLoginViewController will not automatically show its default login failure alert view. Instead, you should show your custom alert view in your implementation.

    Declaration

    Objective-C

    - (void)logInViewController:(nonnull PFLogInViewController *)logInController
        didFailToLogInWithError:(nullable NSError *)error;

    Parameters

    logInController

    The login view controller where login failed.

    error

    NSError object representing the error that occured.

  • Sent to the delegate when the log in screen is cancelled.

    Declaration

    Objective-C

    - (void)logInViewControllerDidCancelLogIn:
            (nonnull PFLogInViewController *)logInController;

    Parameters

    logInController

    The login view controller where login was cancelled.