Guest User

Untitled

a guest
Feb 12th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. PFUser *currentUser = [PFUser currentUser];
  2.  
  3. if (currentUser) {
  4.  
  5. // do stuff with the user
  6. } else {
  7.  
  8. // show the signup or login screen
  9. }
  10.  
  11. [PFUser logInWithUsernameInBackground:@"myname" password:@"mypass" block:(PFUser user, NSError error) {
  12.  
  13. if (user) {
  14. // Do stuff after successful login.
  15. } else {
  16. // The login failed. Check error to see why.
  17. }
  18. }];
  19.  
  20. // Sent to the delegate when a PFUser is logged in.
  21. - (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user {
  22. [self dismissViewControllerAnimated:YES completion:NULL];
  23. [self startMyApplication]; //example
Add Comment
Please, Sign In to add comment