Latest 0.0.5
Homepage https://github.com/shien7654321/STLimitTextField
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit
Authors

Version
License
Platform

A textfield that can limit the length of the text.

STLimitTextField is a textfield that can limit the length of the text. You can limit the length of the text or the length of the character.

STLimitTextFieldPreview01

Requirements

  • iOS 8.0 or later (For iOS 8.0 before, maybe it can work, but I have not tested.)
  • ARC

Installation

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

pod 'STLimitTextField'

Usage

Import headers in your source files

In the source files where you need to use the library, import the header file:

#import <STLimitTextField/STLimitTextField.h>

Initialize STLimitTextField

STLimitTextField is a subclass of UITextFiled. You can initialize it like UITextField, of course you can also use storyboard:

STLimitTextField *textFiled = [[STLimitTextField alloc] init];

Configure STLimitTextFiled

STLimitTextFiled has two ways to limit the length of the text. You can use STLimitLength to limit the length of the text, or use STLimitChar to limit the length of the text characters:

textFiled.limitType = STLimitLength;

STLimitTextFiled can set the limit length with code or storyboard:

textFiled.limit = 5;

STLimitTextFieldPreview02

Author

Suta, [email protected]

License

MIT license.

Latest podspec

{
    "name": "STLimitTextField",
    "version": "0.0.5",
    "summary": "A textfield that can limit the length of the text.",
    "homepage": "https://github.com/shien7654321/STLimitTextField",
    "authors": {
        "Suta": "[email protected]"
    },
    "source": {
        "git": "https://github.com/shien7654321/STLimitTextField.git",
        "tag": "0.0.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "source_files": "STLimitTextField/*.{h,m}",
    "compiler_flags": "-fmodules",
    "description": "STLimitTextField is a textfield that can limit the length of the text."
}

Pin It on Pinterest

Share This