Need help with BZGFormField?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

benzguo
421 Stars 39 Forks MIT License 38 Commits 5 Opened issues

Description

A text field with a validity indicator

Services available

!
?

Need anything else?

Contributors list

# 240,521
Swift
Objecti...
Shell
8 commits
# 75,997
Objecti...
carthag...
alertvi...
uialert...
3 commits
# 171,577
Objecti...
cocoa-t...
iOS
Shell
2 commits
# 277,367
Swift
Objecti...
validat...
iOS
1 commit
# 22,097
Objecti...
Swift
macOS
wwdc
1 commit

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

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

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.