Latest 1.0.0
Homepage https://github.com/developRen/RYJTextField
License MIT
Platforms ios 8.0
Authors

RYJTextField

Support RYJTextField RYJTextField RYJTextField RYJTextField RYJTextField

Quickly add TextField restrictions.✍️

INSTALLATION WITH COCOAPODS

Podfile

To integrate RYJTextField into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'RYJTextField', '~> 1.0.0'
end

Then, run the following command:

$ pod install

USAGE

导入头文件通过RYJTextField创建输入框,即可适用各种限制属性。

#import <RYJTextField.h>

// 创建 RYJTextField 对象
RYJTextField *textField = [[RYJTextField alloc] initWithFrame:CGRectZero fieldType:_fieldType];
// 限制最大字符数
textField.maxCharacterNumber = 5;
// 设置最大输入值(仅数字有效)
textField.maxNumber = 80000;
// 设置最小输入值(仅数字有效)
textField.minNumber = -10000;
// 保留小数点后4位有效数字
textField.decimalPlaces = 4;
// 设置占位符颜色
textField.placeholderColor = [UIColor redColor];
// 设置占位符字体
textField.placeholderFont = [UIFont systemFontOfSize:15];
// 开启屏蔽空格
textField.removeSpace = YES;
// 开启屏蔽表情
textField.removeEmoji = YES;
// 开启自动分组
textField.grouping = YES;

也可以通过UITextField+RYJLimit.hNSString+RYJLimit.h两个分类对UITextField添加限制

#import <UITextField+RYJLimit.h>

UITextField *textField = [[UITextField alloc] init];
// 过滤表情
textField.ryj_emoji = YES;

TARGET

  • [x] 字符数限制
  • [x] 最大/小数值限制
  • [x] 小数点有效位数限制
  • [x] 屏蔽空格
  • [x] 屏蔽表情
  • [x] 数字自动分组(1,234,567)
  • [ ] 输入内容有效性判断(手机号/邮箱/URL/百分比…)

LICENSE

RYJTextField is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "RYJTextField",
    "version": "1.0.0",
    "summary": "Quickly add TextField restrictions.",
    "description": "Quickly add TextField restrictions.u270dufe0f",
    "homepage": "https://github.com/developRen/RYJTextField",
    "license": "MIT",
    "authors": {
        "YiJie Ren": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/developRen/RYJTextField.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "RYJTextField/RYJTextField",
        "RYJTextField/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude"
}

Pin It on Pinterest

Share This