GithubHelp home page GithubHelp logo

miketsprague / hideshowpasswordtextfield Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guidebook/hideshowpasswordtextfield

0.0 2.0 0.0 33 KB

An easy to use `UITextField` subclass that adds a visibility toggle and an optional validation checkmark

License: MIT License

Swift 92.95% Ruby 7.05%

hideshowpasswordtextfield's Introduction

HideShowPasswordTextField

An easy to use UITextField subclass that adds a visibility toggle and an optional validation checkmark

Created by @lookatpete (product), @pklada (design), and @miketsprague (code)

gif

Installation

Cocoapods

pod 'HideShowPasswordTextField', :git => 'https://github.com/Guidebook/HideShowPasswordTextField'

Manual

Just add the files in HideShowPasswordTextField/ to your project.

Usage

  • Create a UITextField in your xib, and change the class name to HideShowPasswordTextField. Or, create it programatically.
  • Set secureTextEntry to true, if you want the password to hide by default.
  • [Recommended] Change the border style to None, and add a height constraint of 44 or larger. The assets in this project are optimized for 44px, although larger is fine too. Smaller sizes might have clipping issues on the icons.
  • Implement UITextFieldDelegate and forward textField shouldChangeCharactersInRange and textFieldDidEndEditing to your password text field (see the example). We have to do this to get the behavior to work right--apple's API doesn't play very nice switching between secureTextEntry states.
    • This step is no longer necessary.
  • [Optional] Implement HideShowPasswordTextFieldDelegate to show the validation checkbox.
  • Customize the textField to your liking (the tint too!)!

hideshowpasswordtextfield's People

Contributors

miketsprague avatar sorianog avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.