uxp

UXPasscodeField

UXPasscodeField is designed for inputting numeric values. It can be used for inputting passcode, PIN, SMS-verification, etc.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

47

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Categories

Readme

UXPasscodeField

[![CI Status](http://img.shields.io/travis/Eddie Lau/UXPasscodeField.svg?style=flat)](https://travis-ci.org/Eddie Lau/UXPasscodeField) Version License Platform

Screenshot

Screenshot

Example Project

To run the example project, clone the repo, and run pod install from the Example directory first.

Sample Code

UXPasscodeField

import UIKit
import UXPasscodeField

class ViewController: UIViewController {

    @IBOutlet weak var passcodeField: UXPasscodeField!

    override func viewDidLoad() {
        super.viewDidLoad()

        passcodeField.becomeFirstResponder()

        // Optional, default is 6
        passcodeField.numberOfDigits = 6

        // Optional, default is false
        passcodeField.isSecureTextEntry = false

        passcodeField.addTarget(
          self,
          action: #selector(ViewController.passcodeFieldDidChangeValue),
          for: .valueChanged)

    }

    @IBAction func passcodeFieldDidChangeValue() {
        print(passcodeField.passcode)
    }

}

UXPasscodeViewController

  let passcodeViewController = UXPasscodeViewController.instantiate()
  passcodeViewController.message = "Hello iOS developer! Please input your 4-digit code here."
  passcodeViewController.numberOfDigits = 4
  passcodeViewController.done { passcode in

      print(passcode)
      _ = passcodeViewController.resignFirstResponder()

  }

Requirements

iOS 8 or above.

Installation

UXPasscodeField is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "UXPasscodeField"

Author

Eddie Lau, eddie@touchutility.com

License

UXPasscodeField is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100