Latest 0.1.4
Homepage https://github.com/sagaya/PinView
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

PinView

CI Status
Version
License
Platform

PinEntryField

About

This project gives you a passcode control that can be dropped into any iOS app. It behaves exactly like the passcode screens that can be seen by going to Settings > General > Passcode Lock.

Features

  • Native iOS look and feel
  • Masks pin entry with bullet characters (If you want a secured entry)
  • Easily customizable
  • Provide custom text to be displayed on the passcode entry view
  • Block-based passcode verification

Installation

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

pod 'PinEntryField'

Manual Installation

Drag the PinView file into your project and voilĂ 

Create a new passcode

import PinView

Create the view inside viewDidLoad

let passcodeView = CodeView(numberOfPin: 4, codeStyle: .line)
passcodeView.isSecureTextEntry = true
//Conform to the protocol `PinInputDelegate` so you will know when the pin entery has been completed
passcodeView.delegate = self
passcodeView.frame = ??
//Yea that is all you have to do!!

The only extra protcol stub is

func didFinishInput(_ inputView: CodeView, didFinishWith text: String) {
    print(text)
}

Example

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

Customization

Attribute Description
isSecureTextEntry Just like it says (secure entry) it will mask out the text
boxSize Custom size for the boxes of type CGSize
codeStyle Three different Styles (rounded,square,line)
spacing Custom line spacing between each box
activeFieldColor background color of the box when the text has been set (defaults to black)
backgroundClr A background color that for the boxes that will always be there, just like the first example
font Custom Font for the text
textColor Text Color for the text
keyboardType Change the type of keyboard (Defaults to numberPad)

Inspired by PinView for Android

Author

sagaya, [email protected]

License

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

Latest podspec

{
    "name": "PinEntryField",
    "version": "0.1.4",
    "summary": "A PIN view library for iOS. Use to enter PIN/OTP/password etc.",
    "swift_version": "4.0",
    "description": "Provides a widget to enter PIN/OTP/password etc on",
    "homepage": "https://github.com/sagaya/PinView",
    "screenshots": "https://github.com/sagaya/BottomDrawer/raw/master/screenshot.gif",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "sagaya": "[email protected]"
    },
    "source": {
        "git": "https://github.com/sagaya/PinView.git",
        "tag": "0.1.4"
    },
    "social_media_url": "https://twitter.com/sagaya_hafeez",
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "PinView/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This