Skip to content

shien7654321/STLimitTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STLimitTextField

Language Platform Version License

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.

About

A textfield that can limit the length of the text.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published