Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. //вход
  2.  
  3. [[FIRAuth auth] signInWithEmail:self.userNameTextField.text
  4. password:self.passwordTextField.text
  5. completion:^(FIRUser * _Nullable user, NSError * _Nullable error) {
  6. if (!error) {
  7.  
  8. } else {
  9. NSLog(@"Error %@", error.localizedDescription);
  10. }
  11. }];
  12.  
  13.  
  14. //регистрация
  15.  
  16. NSString *email = self.emailRegistrationTextField.text;
  17. NSString *password = self.passwordRegistrationTextField.text;
  18.  
  19. [[FIRAuth auth] createUserWithEmail:email
  20. password:password
  21. completion:^(FIRUser * _Nullable user, NSError * _Nullable error) {
  22. if (!error) {
  23.  
  24. self.fireUser = [[TSFireUser alloc] initWithDictionary:(NSDictionary *)user];
  25.  
  26. } else {
  27. NSLog(@"Error - %@", error.localizedDescription);
  28. }
  29. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement