Latest 1.0.0
Homepage https://github.com/Insfgg99x/FGGTextField
License MIT
Platforms ios 7.0, requires ARC
Dependencies AJWValidator
Authors

……………………………………………………..

Introduction

一个超级酷炫的文本输入框,继承自UITextField,依赖于AJWValidator.用于实现文本输入的实时监测。
FGGTextField

Installtion

Manual:

Download This Project and drag the FGGTextField folder into your peroject, do not forget to ensure "copy item if need" being selected.

Cocoapods:

pod 'FGGTextField', '~> 1.0.0'

Usage

Just import the header file:import "FGGTextField.h"

FGGTextField *tf=[[FGGTextField alloc]initWithFrame:CGRectMake(10, 100, kWidth-20, 40)];
[email protected]"请输入邮箱";
[email protected]"邮箱格式不对";
[email protected]"邮箱";
[self.view addSubview:tf];
tf.borderStyle=UITextBorderStyleRoundedRect;
tf.keyboardType=UIKeyboardTypeEmailAddress;

AJWValidator *validator=[AJWValidator validatorWithType:AJWValidatorTypeString];
[validator addValidationToEnsureValidEmailWithInvalidMessage:tf.errorText]; [tf  ajw_attachValidator:validator];
__weak typeof(validator) weak_validator=validator;
validator.validatorStateChangedHandler=^(AJWValidatorState state){
            
        switch (state) {
            case AJWValidatorValidationStateValid:
                tf.highlightState=FGGTextFieldHighlightStateValidator;
                [email protected]"😁";
                break;
             case AJWValidatorValidationStateInvalid:
                 tf.highlightState=FGGTextFieldHighlightStateWrong;
                 [email protected]"😟";
                 break;
             default:
                 break;
         }
         if(weak_validator.isValid){
                
             NSLog(@"格式正确✅");
         }
     };

Explain

1.在项目中导入:FGGTextField.h
2.创建FGGTextField的对象
FGGTextField *tf=[[FGGTextField alloc]initWithFrame:CGRectMake(50, 100, 200, 40)];
3.设置属性
[email protected]"请输入邮箱";
[email protected]"邮箱格式不正确";
[email protected]"邮箱";

tf.borderStyle=UITextBorderStyleRoundedRect;
tf.keyboardType=UIKeyboardTypeEmailAddress;
4.添加到父视图br>如果有问题,可以给我发邮件:[email protected]

About Me

……………………………………………………..

@CGPoitZero

Latest podspec

{
    "name": "FGGTextField",
    "version": "1.0.0",
    "summary": "FGReverser is a Category of NSString used for mutual converting between simplified Chinese and Traditional Chinese.",
    "homepage": "https://github.com/Insfgg99x/FGGTextField",
    "license": "MIT",
    "authors": {
        "CGPointZero": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Insfgg99x/FGGTextField.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "FGGTextField/*.{h,m}",
    "requires_arc": true,
    "dependencies": {
        "AJWValidator": []
    }
}

Pin It on Pinterest

Share This