项目作者: zaimramlan

项目描述 :
An iOS app that imitates Apple's passcode entry
高级语言: Swift
项目地址: git://github.com/zaimramlan/ios-secure-code-entry.git
创建时间: 2018-05-14T18:08:40Z
项目社区:https://github.com/zaimramlan/ios-secure-code-entry

开源协议:MIT License

下载


Secure Code Entry

IDE
Platform
Language
License

An iOS app that imitates Apple’s passcode entry to showcase the a single digit UITextField custom class; SecureCodeTextField.

demo

Features

  1. Only allow a single digit per textfield
  2. Disables UITextField action menu commands to prevent copy/paste
  3. Cursor auto moves to previous/next textfield after a single character text entry
  4. Works with arbitrary amount of textfields on screen

Usages

  1. Copy and paste SecureCodeTextField.swift into your project
  2. Set the custom class of the UITextFields on your storyboard file to SecureCodeTextField
  3. Point the current SecureCodeTextField‘s previousTextField and nextTextField to the respective text fields. For example:

    1. let firstTF = SecureCodeTextField()
    2. let secondTF = SecureCodeTextField()
    3. let thirdTF = SecureCodeTextField()
    4. secondTF.previousTextField = firstTF
    5. secondTF.nextTextField = thirdTF
  4. Your textfields should now jump to previous/next textfields as desired!

More Examples?

Look into the ViewController.swift file and you should be able to understand in the scenario where we have 4 SecureCodeTextFieldss