Tuesday, 10 November 2015

How To Use UIAlertView With Login Password TextField Ios/Iphone

 UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Your_Title" message:@"Your_message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
[av setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

// Alert style customization
[[av textFieldAtIndex:1] setSecureTextEntry:NO];
[[av textFieldAtIndex:0] setPlaceholder:@"First_Placeholder"];
[[av textFieldAtIndex:1] setPlaceholder:@"Second_Placeholder"];
[av show];


=> Here Used Delegate file :-

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
     NSLog(@"1 %@", [alertView textFieldAtIndex:0].text);
     NSLog(@"2 %@", [alertView textFieldAtIndex:1].text);
}