nimati / FCAlertView

FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing textfield properties

FouadRaheb opened this issue · comments

It would be useful to be able to set a default value for the textfield as well as changing other properties.

My Current workaround is updating the properties after a delay.

    DISPATCH_AFTER(0.2, {
            alert.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
            alert.textField.text = text;
    });

Huh interesting workaround. Thanks for bringing this up @FouadRaheb, will look into adding this into the next release.

This is now under dev. Sorry for the wait.

@FouadRaheb

This feature has been added to FCAlertView V1.4.0. Please update and try it by replacing your TextField alert using this:

UITextField *customField = [[UITextField alloc] init];
customField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
        
[alert addTextFieldWithCustomTextField:customField andPlaceholder:@"Placeholder" andTextReturnBlock:^(NSString *text) {
     NSLog(@"Custom TextField Returns: %@", text); // Do what you'd like with the text returned from the field
}];

Thanks for using FCAlertView!