PFLogInViewControllerDelegate Protocol Reference

Conforms to NSObject
Declared in PFLogInViewController.h

Overview

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

Customizing Behavior

– logInViewController:shouldBeginLogInWithUsername:password:

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

- (BOOL)logInViewController:(PFLogInViewController *)logInController shouldBeginLogInWithUsername:(NSString *)username password:(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.

Declared In

PFLogInViewController.h

Responding to Actions

– logInViewController:didLogInUser:

Sent to the delegate when a PFUser is logged in.

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

Parameters

logInController

The login view controller where login finished.

user

PFUser object that is a result of the login.

Declared In

PFLogInViewController.h

– logInViewController:didFailToLogInWithError:

Sent to the delegate when the log in attempt fails.

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

Parameters

logInController

The login view controller where login failed.

error

NSError object representing the error that occured.

Discussion

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.

Declared In

PFLogInViewController.h

– logInViewControllerDidCancelLogIn:

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

- (void)logInViewControllerDidCancelLogIn:(PFLogInViewController *)logInController

Parameters

logInController

The login view controller where login was cancelled.

Declared In

PFLogInViewController.h