Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
- {
- switch (alertView.alertViewStyle)
- {
- case UIAlertViewStylePlainTextInput:
- {
- UITextField *textField = [alertView textFieldAtIndex:0];
- NSLog(@"Plain text input: %@",textField.text);
- NSString *original = textField.text;
- NSString *lowercase = [original lowercaseString];
- NSLog(@"lowercase == %@",lowercase);
- // [PFUser requestPasswordResetForEmailInBackground:@"[email protected]"];
- [PFUser requestPasswordResetForEmailInBackground:lowercase block:^(BOOL succeeded, NSError * _Nullable error) {
- NSLog(@"error == %@",error);
- if(error){
- [[[UIAlertView alloc] initWithTitle:@"Password Reset Error"
- message:@"There was a Error reseting your email."
- delegate:nil
- cancelButtonTitle:@"ok"
- otherButtonTitles:nil] show];
- } else if (!error){
- [[[UIAlertView alloc] initWithTitle:@"Password Reset"
- message:@"An email containing information on how to reset your password has been sent to your email."
- delegate:nil
- cancelButtonTitle:@"ok"
- otherButtonTitles:nil] show];
- }
- }];
- }
- break;
- case UIAlertViewStyleSecureTextInput:
- {
- UITextField *textField = [alertView textFieldAtIndex:0];
- NSLog(@"Secure text input: %@",textField.text);
- }
- break;
- case UIAlertViewStyleLoginAndPasswordInput:
- {
- UITextField *loginField = [alertView textFieldAtIndex:0];
- NSLog(@"Login input: %@",loginField.text);
- UITextField *passwordField = [alertView textFieldAtIndex:1];
- NSLog(@"Password input: %@",passwordField.text);
- }
- break;
- default:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment