CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

RevealTextField 1.0.3

RevealTextField 1.0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Leonardo Cardoso.



RevealTextField

iOS



Simple extension to add a reveal button to your boring UITextField

Requirements

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

Installation

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.