master
 1//
 2//  BlockTextPromptAlertView.h
 3//  BlockAlertsDemo
 4//
 5//  Created by Barrett Jacobsen on 2/13/12.
 6//  Copyright (c) 2012 Barrett Jacobsen. All rights reserved.
 7//
 8
 9#import "BlockAlertView.h"
10
11@class BlockTextPromptAlertView;
12
13typedef BOOL (^BlockTextPromptAlertShouldDismiss)(NSInteger buttonIndex, BlockTextPromptAlertView* theAlert);
14typedef BOOL(^TextFieldReturnCallBack)(BlockTextPromptAlertView *);
15
16@interface BlockTextPromptAlertView : BlockAlertView <UITextFieldDelegate> {
17    
18    NSCharacterSet *unacceptedInput;
19    NSInteger maxLength;
20    NSInteger buttonIndexForReturn;
21}
22
23@property (nonatomic, retain) UITextField *textField;
24
25@property (nonatomic, assign) BOOL disableAutoBecomeFirstResponder;
26@property (nonatomic, assign) BOOL selectAllOnBeginEdit;
27
28+ (BlockTextPromptAlertView *)promptWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultText;
29+ (BlockTextPromptAlertView *)promptWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultText block:(TextFieldReturnCallBack) block;
30
31+ (BlockTextPromptAlertView *)promptWithTitle:(NSString *)title message:(NSString *)message textField:(out UITextField**)textField;
32
33+ (BlockTextPromptAlertView *)promptWithTitle:(NSString *)title message:(NSString *)message textField:(out UITextField**)textField block:(TextFieldReturnCallBack) block;
34
35- (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultText;
36
37- (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultText block: (TextFieldReturnCallBack) block;
38
39@property (readwrite, copy) BlockTextPromptAlertShouldDismiss shouldDismiss;
40
41- (void)setAllowableCharacters:(NSString*)accepted;
42- (void)setUnacceptedInput:(NSCharacterSet*)charSet;
43- (void)setMaxLength:(NSInteger)max;
44
45- (void)setButtonIndexForReturn:(NSInteger)index;
46
47
48@end