Latest 1.2.4
Homepage https://github.com/gho-ramos/GRTextField
License MIT
Platforms ios 8.0
Authors

Build Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Interface Builder

Using it on GRTextField on IB is pretty straightforward, you have use it as the class (at the Identity Inspector Tab on the right panel) for the UITextField element on your storyboard.

Field Class Image

Error Outlet

If you want to set a label as an output source for your error messages, you can drag the "errorLabel" item on the connections inspector

Field Connections Inspector

the field instance will automatically hide the label if you set it as the errorLabel outlet

Field Properties

On the attributes inspector tab, you cant set the properties for the textField

Field Properties

Mask Pattern: Will turn your field into NUMERIC ONLY and will try to match the pattern specified in this property.
e.g.: using (##) #####-#### (BR cellphone mask) as a mask will output the text as (01) 23456-7890

Error Message Key: Will either use a localizable* key specified on a string table file, word or phrase, you decide which one you want to use.

Has Border: Toggle the bottom line on the field.

Max Characters: Set a max number of characters for the field, it will work with alphanumeric characters as well, BUT only if your Mask Pattern is empty, otherwise it will prioritize the Mask Pattern property and ignore this one.

*Unfortunately, at this time the field is only accepting strings from a string table named "localizable.strings", I’ll try to change that asap.

Colors

Border: Defines the color for the bottom line when the field is not selected;

Error: Defines the color for both error label and bottom line when there’s an error**;

Selected: Defines the color for the bottom line when the field is selected and there’s no errors;

Code Usage

There’s no secret mystery behind this one.

GRTextField * textField = [[GRTextField alloc] init];

or

GRTextField * textField = [GRTextField new];

Apart from the properties already specified here (in the upper section), there’s also the documentation on CocoaDocs

Requirements

ARC

Installation

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

pod "GRTextField"

Author

[email protected]

License

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

Latest podspec

{
    "name": "GRTextField",
    "version": "1.2.4",
    "summary": "Customizable TextField",
    "description": "A customizable TextField in OBJC with possibility of attaching own error labels and custom colors to its own validation",
    "homepage": "https://github.com/gho-ramos/GRTextField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Pogramos": "[email protected]"
    },
    "source": {
        "git": "https://github.com/gho-ramos/GRTextField.git",
        "tag": "1.2.4"
    },
    "social_media_url": "https://twitter.com/pogramos",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": [
        "GRTextField/Classes/**/*",
        "GRTextField/Extensions/**/*",
        "GRTextField/Protocols/**/*"
    ]
}

Pin It on Pinterest

Share This