Latest 0.1.0
Homepage https://github.com/thewhitewood/WWPasscodeInput
License MIT
Platforms ios 9.3
Authors

CI Status
Version
License
Platform

Features

  • Set the length of input required
  • Set the size of input indicators
  • Set colours for background and borders of input indicators for idle and completed states
  • Set the border size of input indicators
  • Set custom font and text color for input previews
  • Check the input and completion of input via WWPasscodeInputDelegate

Example

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

Requirements

  • iOS 9.3+
  • Xcode 10.0+
  • Swift 4.2+

Installation

CocoaPods

To integrate WWPasscodeInput into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'WWPasscodeInput'

Manually

Download and add WWPasscodeInput.swift to your project.

Usage

Quick Start

Example using autolayout constraints.

import WWPasscodeInput

class MyViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let passcodeField = WWPasscodeInput()
        view.addSubview(passcodeField)

        passcodeField.translatesAutoresizingMaskIntoConstraints = false

        let horizontalConstraint = NSLayoutConstraint(item: passcodeField, attribute: NSLayoutConstraint.Attribute.centerX, relatedBy: NSLayoutConstraint.Relation.equal, toItem: view, attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1, constant: 0)
        let verticalConstraint = NSLayoutConstraint(item: passcodeField, attribute: NSLayoutConstraint.Attribute.centerY, relatedBy: NSLayoutConstraint.Relation.equal, toItem: view, attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: 0)
        view.addConstraints([horizontalConstraint, verticalConstraint])
    }

}

Author

Nicholas Wood – thewhitewood.com / @thewhitewood

License

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

Latest podspec

{
    "name": "WWPasscodeInput",
    "version": "0.1.0",
    "summary": "Customisable passcode input view",
    "description": "WWPasscodeInput is a customisable number passcode view written in Swift.",
    "homepage": "https://github.com/thewhitewood/WWPasscodeInput",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/thewhitewood/WWPasscodeInput.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/thewhitewood",
    "platforms": {
        "ios": "9.3"
    },
    "swift_version": "4.2",
    "source_files": "WWPasscodeInput/Classes/**/*"
}

Pin It on Pinterest

Share This