Skip to content

Instantly share code, notes, and snippets.

@Adam0101
Created November 6, 2011 21:36
Show Gist options
  • Save Adam0101/1343535 to your computer and use it in GitHub Desktop.
Save Adam0101/1343535 to your computer and use it in GitHub Desktop.
UIAlertViewStyleLoginAndPassword
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
NSLog(@"Username:%@",[[alertView textFieldAtIndex:0] text]);
NSLog(@"Password:%@",[[alertView textFieldAtIndex:1] text]);
}
}
- (IBAction)ClickedMe:(id)sender {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Click Me!"
message:@"Fill out the text field..."
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Ok", nil];
alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
[alert show];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment