Latest 1.0.0
Homepage https://github.com/CainLuo/JQUnitField
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Foundation
Authors

JQUnitField:验证码输入框,自定义密码输入框,支持密文,支持框颜色,间隔,文本设置,闪烁光标移动,自定义键盘响应!只需要一个view就能实现哦!

CocoaPods

pod ‘JQUnitField’

效果如下

JQUnitField
JQUnitField

Instalation

Add the JQUnitField.h and JQUnitField.m source files to your project.

Usage

Storyboard/XIB 或 纯代码两种方式,demo中是Storyboard,实现原理一样!
@property (nonatomic, strong) JQUnitField *unitField;

    _unitField = [[JQUnitField alloc]initWithFrame:CGRectMake(50, 100, [UIScreen mainScreen].bounds.size.width-100, 40)];

    _unitField.inputUnitCount = 6;    // 位数 1~9 
    _unitField.secureTextEntry = YES; // 密文 默认NO

    // ...... 还有很多自定义可以设置,这里不一一举例了
    _unitField.delegate = self;

   // 检测数据变化
   [_unitField addTarget:self action:@selector(unitFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged];

    [self.view addSubview:_unitField];

    // 检测数据变化
- (void)unitFieldEditingChanged:(JQUnitField *)sender
{
    NSLog(@"%@", sender.text); // 我们想要的数据
}
JQUnitFieldDelegate 代理方法
#pragma Mark --- JQUnitFieldDelegate ---
- (BOOL)unitField:(JQUnitField *)uniField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    return YES;
}
收回键盘
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view.window endEditing:YES];
}

Other

JQTumblrHud-高仿Tumblr App 加载指示器hud

JQScrollNumberLabel:仿tumblr热度滚动数字条数

TumblrLikeAnimView-仿Tumblr点赞动画效果

JQMenuPopView-仿Tumblr弹出视图发音频、视频、图片、文字的视图

Star

iOS开发者交流群:446310206 喜欢就❤️❤️❤️star一下吧!你的支持是我更新的动力! Love is every every every star! Your support is my renewed motivation!

License

This code is distributed under the terms and conditions of the MIT license.

Latest podspec

{
    "name": "JQUnitField",
    "version": "1.0.0",
    "summary": "u9a8cu8bc1u7801u8f93u5165u6846uff0cu81eau5b9au4e49u5bc6u7801u8f93u5165u6846uff0cu652fu6301u5bc6u6587uff0cu652fu6301u6846u989cu8272uff0cu95f4u9694uff0cu6587u672cu8bbeu7f6euff0cu95eau70c1u5149u6807u79fbu52a8uff0cu81eau5b9au4e49u952eu76d8u54cdu5e94uff01u53eau9700u8981u4e00u4e2aviewu5c31u80fdu5b9eu73b0u54e6uff01",
    "homepage": "https://github.com/CainLuo/JQUnitField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "CainLuo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/CainLuo/JQUnitField.git",
        "tag": "1.0.0"
    },
    "source_files": "JQUnitField/**/*.{h,m}",
    "requires_arc": true,
    "frameworks": [
        "UIKit",
        "Foundation"
    ]
}

Pin It on Pinterest

Share This