ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - PiXeL16/PasswordTextField: A custom TextField with a switchable icon which shows or hides the password and enforce good password policies
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies - PiXeL16/PasswordTextField
Visit Site

GitHub - PiXeL16/PasswordTextField: A custom TextField with a switchable icon which shows or hides the password and enforce good password policies

GitHub - PiXeL16/PasswordTextField: A custom TextField with a switchable icon which shows or hides the password and enforce good password policies

PasswordTextFieldBanner

Build Status codecov.io Swift Package Manager CocoaPods Compatible Carthage compatible Awesome GitHub license Language

PasswordTextField

A custom TextField with a switchable icon which shows or hides the password and enforces good password policies, written in Swift.

PasswordTextFieldGif

:star: Features

  • Custom toggle icon in IB or programmatically.
  • Custom icon color in IB or programmatically.
  • Custom password validation rules.
  • Custom password validation error message.
  • Control when to show the icon, while editing, always or never.

:octocat: Installation

Swift Package Manager (SPM)

  1. In Xcode 11+ select File > Packages > Add Package Dependency....
  2. Enter this project's URL: https://github.com/PiXeL16/PasswordTextField.git

CocoaPods

You can use CocoaPods to install PasswordTextField by adding it to your Podfile:

platform :ios, '12.0'
use_frameworks!
pod 'PasswordTextField'

To get the full benefits import PasswordTextField wherever you import UIKit

import UIKit
import PasswordTextField

Carthage

Create a Cartfile that lists the framework and run carthage bootstrap. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/PasswordTextField.framework to an iOS project.

github "PiXeL16/PasswordTextField"

Manually

  1. Download and drop /PasswordTextField folder in your project.
  2. Congratulations!

:metal: Usage

  1. Open a storyboard or Xib file.
  2. Drag and drop a UITextField to a ViewController.
  3. In Identity Inspector, replace the class from UITextField to PasswordTextField and the module to PasswordTextField.
  4. Configure your properties in the Attribute Inspector.

Screenshot

Properties

Property name Data type Remark
Show Toggle Button While String Possible values are editing(default), always, never
Image Tint Color UIColor The color off the Toggle image, the functionality use UIImageRenderingMode.AlwaysTemplate to change the default or custom image color
Custom Show Secure Text Image UIImage Your custom image to show the secure text
Custom Hide Secure Text Image UIImage Your custom image to hide the secure text

Validation

PasswordTextField also provides functionality to enforce good password policies.

It will currently validate that the password format is at least 8 characters long and contain one uppercase letter and one number.

import PasswordTextField

if passwordTextField.isInvalid(){
  print(passwordTextField.errorMessage)
}

You can also provide your custom password validation format (with Regex) and error message:

import PasswordTextField

let validationRule = RegexRule(regex:"^[A-Z ]+$", errorMessage: "Password must contain only uppercase letters")

passwordTextField.validationRule = validationRule

if passwordTextField.isInvalid(){
  print(passwordTextField.errorMessage)
}

TODO

  • Show indication when password is strong or weak in TextField
  • Animation when toggling Button

:alien: Author

Chris Jimenez - http://code.chrisjimenez.net, @chrisjimeneznat

:beer: Donate

If you want to buy me a beer, you can donate to my coin addresses below:

BTC

1BeGBew4CBdLgUSmvoyiU1LrM99GpkXgkj

ETH

0xa59a3793E3Cb5f3B1AdE6887783D225EDf67192d

LTC

Ld6FB3Tqjf6B8iz9Gn9sMr7BnowAjSUXaV

License

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

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory