Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed populating default text of BlockTextPromptAlertView #56

Merged
merged 1 commit into from

2 participants

@falkobuttler

No description provided.

@barrettj barrettj merged commit 36ac512 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 13, 2013
  1. Fixed populating default text of BlockTextPromptAlertView

    Falko Buttler authored
This page is out of date. Refresh to see the latest.
View
1  BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.h 100644 → 100755
@@ -18,6 +18,7 @@ typedef BOOL(^TextFieldReturnCallBack)(BlockTextPromptAlertView *);
NSCharacterSet *unacceptedInput;
NSInteger maxLength;
NSInteger buttonIndexForReturn;
+ NSString* defaultText;
}
@property (nonatomic, retain) UITextField *textField;
View
8 BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.m
@@ -59,6 +59,7 @@ - (void)addComponents:(CGRect)frame {
theTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
theTextField.delegate = self;
+ theTextField.text = defaultText;
self.textField = theTextField;
}
@@ -71,13 +72,14 @@ - (void)addComponents:(CGRect)frame {
}
-- (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultText {
+- (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultTxt {
self = [super initWithTitle:title message:message];
if (self) {
maxLength = 0;
buttonIndexForReturn = 1;
+ defaultText = defaultTxt;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
@@ -91,9 +93,9 @@ - (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(N
return self;
}
-- (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultText block: (TextFieldReturnCallBack) block {
+- (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(NSString*)defaultTxt block: (TextFieldReturnCallBack) block {
- self = [self initWithTitle:title message:message defaultText:defaultText];
+ self = [self initWithTitle:title message:message defaultText:defaultTxt];
if (self) {
self.callBack = block;
Something went wrong with that request. Please try again.