Git Product home page Git Product logo

rzcarplatenotextfield's Introduction

RZCarPlateNoTextField (iOS 车牌号 键盘)

iOS 车牌号键盘 对UITextField封装一个专用车牌号输入键盘

对键盘的inputView做了一个替换,输入项只能选择输入车牌号(省(或特殊车牌)+数字字母+特殊汉字)

  • RZCarPlateNoTextField 包含两个主要使用类
    • RZCarPlateNoTextField
      • 继承自UITextField,
      • 可设置是否显示车牌号输入键盘
      • 最大输入长度 (0 不限制长度)
      • rz_regexPlateNoIfYouNeed(block方法) 可自行设计车牌号校验格式,参考[RZCarPlateNoKeyBoardViewModel rz_regexPlateNo:]方法,我的校验方法不是最好的,只是一个初步思路。
      • rz_textFieldEditingValueChanged 输入变化之后的回调
    • RZCarPlateNoInputAlertView
      • 以ViewController的形式,alert弹出框样式输入车牌号

使用RZCarPlateNoTextField

  • pod加入项目
    pod 'RZCarPlateNoTextField'

或将项目中Core文件夹拖入目标项目

  • RZCarPlateNoTextField
    RZCarPlateNoTextField *textfield = [[RZCarPlateNoTextField alloc] initWithFrame:CGRectMake(10, 100, 300, 50)];
//    textfield.backgroundColor = [UIColor colorWithWhite:0.7 alpha:1];
//    textfield.rz_maxLength = 0;  // 最大输入长度 (0 不限制)
//    textfield.rz_checkCarPlateNoValue = NO;  // 是否需要校验车牌号输入规则
//    textfield.rz_regexPlateNoIfYouNeed = ^NSString * _Nonnull(NSString * _Nonnull text) {
//        // 你的校验方法,
//        return text;
//    };
//    textfield.rz_textFieldEditingValueChanged = ^(RZCarPlateNoTextField * _Nonnull textField) {
//        NSLog(@"输入变化回调:%@", textField.text);
//    };
//    [textfield rz_changeKeyBoard:NO]; // 代码控制显示字母 (YES:省份)
    [self.view addSubview:textfield];
  • RZCarPlateNoInputAlertView
[RZCarPlateNoInputAlertView showToVC:self plateNo:@"" title:@"请输入车牌号" plateLength:8 complete:^(BOOL isCancel, NSString * _Nonnull plateNo) {
    NSLog(@"plateNo:%@", plateNo);
    }];
}];

键盘样式(省区) 键盘样式(数字字母)

键盘样式(弹出窗样式)

rzcarplatenotextfield's People

Contributors

rztime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rzcarplatenotextfield's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.