I need to add a TextField
to an UIAlertView
. I understand that apple discourage this approach. So is there any library that i could make use of to add
I'm using BlockAlertsAndActionSheets instead of the Apple components for AlertViews and ActionSheets as I prefer the blocks-approach. Also contains a BlockTextPromptAlertView
in the source, which might be what you want. You can replace the images of that control to get the Apple-style back.
Project on gitgub
Tutorial which gets you started
Example:
- (IBAction)newFolder:(id)sender {
id selfDelegate = self;
UITextField *textField;
BlockTextPromptAlertView *alert = [BlockTextPromptAlertView promptWithTitle :@"New Folder"
message :@"Please enter the name of the new folder!"
textField :&textField];
[alert setCancelButtonWithTitle:@"Cancel" block:nil];
[alert addButtonWithTitle:@"Okay" block:^{
[selfDelegate createFolder:textField.text];
}];
[alert show];
}
- (void)createFolder:(NSString*)folderName {
// do stuff
}