Latest 1.0.3
Homepage https://github.com/LeonardoCardoso/RevealTextField
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation
Authors

RevealTextField

iOS

Platform
CocoaPods
Carthage Compatible

Simple extension to add a reveal button to your boring UITextField

Requirements

  • iOS 8.0+
  • Swift 3.0+
  • Xcode 8.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build RevealTextField 1.0.3+.

To integrate RevealTextField into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'RevealTextField', '~> 1.0.3'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate RevealTextField into your Xcode project using Carthage, specify it in your Cartfile:

github "LeonardoCardoso/RevealTextField" ~> 1.0.3

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate RevealTextField into your project manually.

Usage

You can use a RevealTextField on any UITextField by just calling the function revealable(). Yes it’s an extension, not a subclass:

let passwordTextField = UITextField()
passwordTextField.isSecureTextEntry = true
passwordTextField.revealable() // <<---

Customizing

passwordTextField.revealable(secureImage: UIImage?,     // <<--- isSecureTextEntry == true. 
                             unsecureImage: UIImage?,   // <<--- isSecureTextEntry == false.
                             tintColor: UIColor?,       // <<--- image color, default is black.
                             dimension: CGFloat?)       // <<--- image dimension, default is 30.

Functions

  • revealable() transforms your boring UITextField into a Revealing UITextField.
  • toggleReveal() toggles the review automatically at any time. It applies to every UITextField.
  • toggleImage(_ isSecure: Bool) toggles revealing image at any time.

License

RevealTextField is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "RevealTextField",
    "version": "1.0.3",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Simple extension to add a reveal button to your boring UITextField",
    "homepage": "https://github.com/LeonardoCardoso/RevealTextField",
    "social_media_url": "https://twitter.com/leocardz",
    "authors": {
        "Leonardo Cardoso": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LeonardoCardoso/RevealTextField.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Sources/**/*.swift",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This