Latest 1.0.9
Homepage https://github.com/StockX/PinEntryView
License MIT
Platforms ios 8.0
Authors

PinEntryView Logo


Platform
Version
License

Description

PinEntryView is a customizable view written in Swift that can be used to confirm alphanumeric pins. Use cases include typing ACCEPT after reviewing Terms of Service and setting or confirming a passcode.

screen shot 2017-04-27 at 5 01 21 pm

Contents

  1. Features
  2. Installation
  3. Supported OS & SDK versions
  4. Usage
  5. License
  6. Contact

Features

  • [x] Supports AutoLayout and has intrinsic size. Optionally set a height to make the boxes taller or a width to add more inner spacing between boxes.
  • [x] Fully configurable in Interface Builder (supports @IBDesignable and @IBInspectable) and code.
  • [x] Customizable for many different use cases.
  • [x] Example app to demonstrate the various configurations.

Example Project Screenshot

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

$ gem install cocoapods

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

pod 'PinEntryView'

Then, run the following command:

$ pod install

In case Xcode complains ("Cannot load underlying module for PinEntryView") go to Product and choose Clean (or simply press K).

Manually

If you prefer not to use CocoaPods, you can integrate PinEntryView into your project manually.

Supported OS & SDK Versions

  • Supported build target – iOS 8.0+ (Xcode 8.3.2+)

Usage

PinEntryView is state based. To configure the view, simply update the state value with whatever values you’d like, and re-set the state:

1) First you should set up the PinEntryView and provide an initial state:

var pinEntryView = PinEntryView()
pinEntryView.state = PinEntryView.State(pin: "ACCEPT",
                                        allowsBackspace: true,
                                        showsPlaceholder: true,
                                        placeholderTextColor: .lightGray,
                                        allowsAllCharacters: false,
                                        focusBorderColor: .black,
                                        inactiveBorderColor: .lightGray,
                                        completedBorderColor: .green,
                                        errorBorderColor: .red,
                                        returnKeyType: .done)

2) Once set, you can optionally adjust individual parameters in the state:

Reassigning one var can be done in line:

pinEntryView.state?.returnKeyType = .next

or

Group up reassigning multiple vars that way only one update (PinEntryView.update()) cycle is made:

var state = pinEntryView.state
state?.completedBorderColor = .clear
state?.showsPlaceholder = false
pinEntryView.state = state

License

PinEntryView is developed by Jeff Burt at StockX and is released under the MIT license. See the LICENSE file for details.

Contact

Feel free to follow me on my personal Twitter account. If you find any problems with the project or have ideas to enhance it, feel free to open a GitHub issue and/or create a pull request.

Latest podspec

{
    "name": "PinEntryView",
    "version": "1.0.9",
    "screenshots": "https://cloud.githubusercontent.com/assets/2835199/25539360/d8ca88be-2c14-11e7-809d-5ef620524d1a.png",
    "summary": "PinEntryView is a customizable view written in Swift that can be used to confirm alphanumeric pins.",
    "description": "PinEntryView is a customizable view written in Swift that can be used to confirm alphanumeric pins. Use cases include typing ACCEPT after reviewing Terms of Service and setting or confirming a passcode.nnFeatures:n- Supports AutoLayout and has intrinsic size. Optionally set a height to make the boxes taller or a width to add more inner spacing between boxes.n- Fully configurable in Interface Builder (supports @IBDesignable and @IBInspectable) and code.n- Customizable for many different use cases.n- Example app to demonstrate the various configurations.",
    "homepage": "https://github.com/StockX/PinEntryView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jeff Burt": "[email protected]"
    },
    "source": {
        "git": "https://github.com/StockX/PinEntryView.git",
        "tag": "1.0.9"
    },
    "social_media_url": "https://twitter.com/jeffburtjr",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "PinEntryView/Classes/**/*",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This