by benzguo

benzguo / BZGFormField

A text field with a validity indicator

424 Stars 40 Forks Last release: Not found MIT License 38 Commits 5 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


is a text field with a validity indicator. UI/UX inspired by @muffs

alt tag

The left indicator changes color based on the validity of the field's text - just pass the field a text validation block:

[self.passwordField setTextValidationBlock:^BOOL(BZGFormField *field, NSString *text) {
    return (text.length >= 8);

alt tag

When the text field returns, the indicator expands and becomes tappable.

alt tag

When the indicator is tapped, an alert view is displayed - you can configure the alert view in the text validation block.

[self.passwordField setTextValidationBlock:^BOOL(BZGFormField *field, NSString *text) {
    if (text.length < 8) {
        field.alertView.title = @"Password is too short";
        return NO;
    } else {
        return YES;

alt tag


If you're using cocoapods, add

pod 'BZGFormField'
to your Podfile. Otherwise, add
to your project.


Check out the sample Xcode project in


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.