Latest 1.1.1
Homepage https://github.com/zattoo/TvOSPinKeyboard
License MIT
Platforms tvos 9.0
Dependencies FocusTvButton, Cartography

PIN keyboard for tvOS

TvOSPinKeyboard

Description

TvOSPinKeyboard is a view controller that allows easily asking for PIN codes in tvOS.

Requirements

  • tvOS 9.0+
  • Xcode 8.2

Installation

Cocoapods

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

source 'https://github.com/CocoaPods/Specs.git'
platform :tvos, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'TvOSPinKeyboard', '~> 1.1.1'
end

Usage

All you need is to create an instance of TvOSPinViewController and to present it on the screen. Pin code will be sent back through TvOSPinKeyboardDelegate


import UIKit
import TvOSPinKeyboard

class ViewController: UIViewController, TvOSPinKeyboardViewDelegate {

    @IBOutlet private weak var pinLabel: UILabel!

    @IBAction func pinButtonWasPressed(_ sender: Any) {
        let pinKeyboard = TvOSPinKeyboardViewController(withTitle: "Introduce your PIN", message: "A pin code is required")
        pinKeyboard.delegate = self

        present(pinKeyboard, animated: true, completion: nil)
    }

    // MARK: - TvOSPinKeyboardViewDelegate

    func pinKeyboardDidEndEditing(pinCode: String) {
        pinLabel.text = "Your Pin Code is: " + pinCode
    }
}

Customization

Apart from the title, subtitle, TvOSPinKeyboard offers a wide level of customization

Customizable properties:

  • backgroundView
  • pinLength
  • titleFont
  • titleColor
  • subtitleFont
  • subtitleColor
  • pinFont
  • pinColor
  • pinBackgroundColor
  • numpadButtons
  • numpadFont
  • deleteButtonTitle
  • deleteButtonFont
  • buttonsNormalTitleColor
  • buttonsFocusedTitleColor
  • buttonsFocusedBackgroundColor
  • buttonsFocusedBackgroundEndColor
  • buttonsNormalBackgroundColor
  • buttonsNormalBackgroundEndColor

Latest podspec

{
    "name": "TvOSPinKeyboard",
    "authors": "Zattoo",
    "version": "1.1.1",
    "license": "MIT",
    "summary": "PIN keyboard for tvOS",
    "homepage": "https://github.com/zattoo/TvOSPinKeyboard",
    "source": {
        "git": "https://github.com/zattoo/TvOSPinKeyboard.git",
        "tag": "1.1.1"
    },
    "platforms": {
        "tvos": "9.0"
    },
    "source_files": "Sources/**/*.swift",
    "dependencies": {
        "FocusTvButton": [],
        "Cartography": []
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This