Latest 5.2.1
Homepage https://github.com/JKshared92/JKNumberKeyBoard
License MIT
Platforms ios 6.0, requires ARC
Authors

自定义数字键盘,简单快捷

image

1、导入

   直接下载,将下载下来文件夹里面的 JKNumberKeyBoard 直接拖到所需的项目中即可
   使用cocoapod   pod 'JKNumberKeyBoard'
 

2、使用

只需在使用的地方<br>

#import "JKNumberTextField.h"

创建输入框时用JKNumberTextField创建就好

JKNumberTextField是继承UITextField,所以属性设置都不用变

用[[JKNumberTextField alloc] init]创建,设置代理JKDelegate即可

用法与UITextField一致
#import "JKNumberTextField.h"

//代理<JKNumberTextFieldDelegate>

{
    JKNumberTextField *textField = [[JKNumberTextField alloc] init];
    textField.JKDelegate = self;
    /** 创建用init,代理注意不要写成delegete了
     *  继承于YUTextField,设置属性就好,暂不支持xib和sb
     */
    textField.frame = CGRectMake(50, 200, 200, 30);
    textField.borderStyle = UITextBorderStyleRoundedRect;
    textField.point = NO;/**可以选择不要小数点,默认支持小数点*/
    [self.view addSubview:textField];
}

//实现代理方法即可
/**点击收键盘时调用*/
- (void)textFieldDidComplete:(JKNumberTextField *)textField andText:(NSString *)text {
    [textField resignFirstResponder];
}

/**值变化时调用*/
- (void)textFieldDidChangeAnyValue:(JKNumberTextField *)textField andText:(NSString *)text {
        //这里的text不是变化的值,是textField的text
}

也可以去我的简书看看其他的

Latest podspec

{
    "name": "JKNumberKeyBoard",
    "version": "5.2.1",
    "summary": "I love you , never change",
    "homepage": "https://github.com/JKshared92/JKNumberKeyBoard",
    "license": "MIT",
    "authors": {
        "u8881u6770": "[email protected]"
    },
    "source": {
        "git": "https://github.com/JKshared92/JKNumberKeyBoard.git",
        "tag": "5.2.1",
        "submodules": true
    },
    "source_files": "JKNumberKeyBoard/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "6.0"
    },
    "resources": "JKNumberKeyBoard/*"
}

Pin It on Pinterest

Share This