Latest 0.1.4
Homepage https://github.com/AbeiOS/LFYTextInputFilter
License MIT
Platforms ios 8.0
Authors

Pod version
CocoaPods
CI Status
Version
License
Platform

只允许中文输入

image

只允许数字输入

image

同时支持多种组合

创建简单,两步即可

  1. 生成过滤对象

    /// 只能输入字母和数字 
    [_textField2 lfy_makeStrategy:^(LFYStrategyMaker *make) {
        make.lfy_limit(15).lfy_option(LFYStrategyOptionNumber | LFYStrategyOptionCharacter);
    }];
    
    /// 不能输入空格
    [_textField4 lfy_makeStrategy:^(LFYStrategyMaker *make) {
        make.lfy_limit(10).lfy_option(LFYStrategyOptionWhitespace).lfy_inverted();
    }];
  2. 调用 filter 方法
    
    #pragma mark - 请先设置 Delegate

/// 如果是 textField 请先添加通知

  • (void)textFieldDidChanged:(NSNotification )notification
    {
    UITextField
    textField = notification.object;
    [textField filter];
    }

  • (void)textViewDidChange:(UITextView *)textView
    {
    [textView filter];
    }

Requirements

iOS 8.0

Installation

LFYTextInputFilter is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'LFYTextInputFilter'

Author

[email protected]

License

LFYTextInputFilter is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LFYTextInputFilter",
    "version": "0.1.4",
    "summary": "A UITextField and UITextView Category can filter character",
    "description": "'A 'UITextField' and 'UITextView' Category that can filter character, it filter you needn't character'",
    "homepage": "https://github.com/AbeiOS/LFYTextInputFilter",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AbeiOS/LFYTextInputFilter.git",
        "tag": "0.1.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "LFYTextInputFilter/Classes/**/*"
}

Pin It on Pinterest

Share This