Latest 1.3.0
Homepage https://github.com/anelad/LoginTextField
License MIT
Platforms ios 10.0
Authors

Version
License
Platform

LoginTextField is a subclass of UITextField.

Using LoginTextField, you can easily set images to the left of the field. It has a seperator between the field’s text and left image. If your field has "secure text entry" option, it automatically displays a "show/hide password" button in it.

LoginTextField’s almost all subs can change its color, including the placeholder.

It has built-in support for validations. All you need to call handleError(isValid:) function. You can do validation easily using Validator by Adam Waite.

Features

  • All variables are bound to the storyboards/.xibs via IBInspectables.
  • Built-in error showing function.
  • You can change the color of all subs.
  • Very tiny.

Usage

You can initialize LoginTextField programmatically or in a storyboard/.xib.

If you are using storyboard or .xib file, you should set borderStyle to .none. Otherwise you might experience unexpected behaviours, especially with corder radius.

If you are using storyboards/.xibs you can set all the variables using interface builder.

If you are initializing the calss programmatically, these are your todo’s:

Initialization

let field = LoginTextField.init(frame: CGRect.zero)   //set your own rect.

Left Image

field.image = UIImage...

Left Image and "show/hide password button" Color

field.defaultColor = UIColor...

Placeholder Color

field.placeholderColor = UIColor...

Error

field.errorBorderWidth = CGFloat...
field.errorColor = UIColor...   //if you will use handleError(isValid:) function, you should specify an error color for validation errors. This color is used when handleError(isValid:) return false.

Seperator Line Color

field.seperatorLineColor = UIColor...

Corner Radius

field.cornerRadius = CGFloat...

Border

field.borderWidth = CGFloat...
field.borderColor = UIColor...

Handling Validation Errors

field.handleError(isValid: ....)   //this will change the left image color, the seperator line color and the border color.

Requirements

LoginTextField requires min version of iOS10 and Swift4

Installation

CocoaPods

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

pod 'LoginTextField'

Author

Arda Oğul Üçpınar, [email protected]

Contribution

Any contributions and suggestions are most welcome! Please update the README with any new features. Thanks!

License

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

Latest podspec

{
    "name": "LoginTextField",
    "version": "1.3.0",
    "summary": "A tiny UITextField subclass to use in login / registration forms.",
    "description": "LogintextField is a tiny subclas of UITextField. It's designed to fulfill almost any needs of a small forms like login or registration.",
    "homepage": "https://github.com/anelad/LoginTextField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Arda Ogu0306ul Uu0308cu0327pu0131nar": "[email protected]"
    },
    "source": {
        "git": "https://github.com/anelad/LoginTextField.git",
        "tag": "1.3.0"
    },
    "social_media_url": "https://twitter.com/ArdaUcpinar",
    "platforms": {
        "ios": "10.0"
    },
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "source_files": "LoginTextField/Classes/**/*",
    "resources": [
        "LoginTextField/Assets/**/*.xcassets"
    ],
    "testspecs": [
        {
            "name": "Test",
            "test_type": "unit",
            "source_files": [
                "LoginTextField/LoginTextFieldTests/**/*.swift",
                "LoginTextField/Classes/**/*"
            ],
            "pod_target_xcconfig": {
                "SWIFT_VERSION": "4.0"
            }
        }
    ]
}

Pin It on Pinterest

Share This