Skip to content

A text field with a validity indicator for better forms. (iOS)

License

Notifications You must be signed in to change notification settings

jfsagasti/BZGFormField

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BZGFormField

BZGFormField 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(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.

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

alt tag

Installation

If you're using cocoapods, add pod 'BZGFormField' to your Podfile. Otherwise, add BZGFormField/BZGFormField.h and BZGFormField/BZGFormField.m to your project.

Usage

Check out the sample Xcode project in Example

About

A text field with a validity indicator for better forms. (iOS)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 100.0%