A Swifty iOS PIN Screen

Overview

SAPinViewController

Build Status Version License Platform

Simple and easy to use default iOS PIN screen. This simple library allows you to draw a fully customisable PIN screen same as the iOS default PIN view. My inspiration to create this library was form THPinViewController, however SAPinViewController is completely implemented in Swift. Also the main purpose of creating this library was to have simple, easy to use and fully customisable PIN screen.

Features

  • Support both iPhone and iPad landscape/portrait
  • Designed with the help of SnapKit
  • Fully customisable:
    • change title font/colour
    • change subtitle font/colour
    • change numbers font/colour
    • change alphabet font/color
    • change numbers boundary colour
    • change PIN dots color
    • add solid background colour
    • add custom image as background and gets blurred automatically
    • hide alphabets
    • change cancel button font/colour
    • NEW in 0.1.2:
      • now you can have your logo on top as well
      • now you can have rounded rect as well as circle type UI

Usage

// initial a "SAPinViewController" via the designate initialiser
let pinVC = SAPinViewController(withDelegate: self, backgroundImage: UIImage(named: "bg3"))
// setup different properties
pinVC.subtitleText = "Your passcode is required to enable Touch ID"
pinVC.buttonBorderColor = UIColor.whiteColor()
pinVC.alphabetColor = UIColor.whiteColor()
pinVC.showAlphabet = true // default is true
// ... and other properties
// present it
presentViewController(pinVC, animated: true, completion: nil)
// implement delegate methods
extension ViewController: SAPinViewControllerDelegate {
    func pinEntryWasCancelled() {
        dismissViewControllerAnimated(true, completion: nil)
    }
    func pinEntryWasSuccessful() {
        dismissViewControllerAnimated(true, completion: nil)
    }
    func pinWasIncorrect() {

    }
    func isPinValid(pin: String) -> Bool {
        return pin == pinString
    }
}

Screenshots

With Logo:

iPhone 4

iPhone 5

iPhone 6

iPhone 6 plus

iPad landscape

iPad portrait

Example

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

Requirements

  • Minimum iOS 8

Installation

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

pod "SAPinViewController"

Author

Siavash, [email protected]

License

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

Contribution

If you have any feature requests or bug-fixes feel free to create an issue or send a pull request.

You might also like...
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

πŸ”’ Swift Obfuscator that protects iOS apps against reverse engineering attacks.
πŸ”’ Swift Obfuscator that protects iOS apps against reverse engineering attacks.

struct fjiovh4894bvic: XbuinvcxoDHFh3fjid { let VNfhnfn3219d: Vnahfi5n34djga func cxncjnx8fh83FDJSDd() - Lghbna2gf0gmh3d { return vPAOSNdcbif

Simple Objective-C wrapper for the keychain that works on Mac and iOS

SAMKeychain SAMKeychain is a simple wrapper for accessing accounts, getting passwords, setting passwords, and deleting passwords using the system Keyc

πŸ¦‹ν›„λ¦μ˜ iOS 이것저것 κ³΅λΆ€ν•΄λ³΄λŠ” λ ˆν¬πŸ¦‹

πŸ¦‹ iOS Practice Repo πŸ¦‹ πŸ€” μ •μ‹ μ°¨λ € 후릐야.. "도약".. 해야지? ✨ ✨ ✨ iOS κ°œλ°œμ„ κ³΅λΆ€ν•œ κ±Έ κΈ°λ‘ν•©λ‹ˆλ‹€. λ‚ μ§œ κ³΅λΆ€ν•œ λ‚΄μš© ν”„λ‘œμ νŠΈ λ‚΄μš© 정리 6μ›” 16일 Expandable TableView πŸ‘©β€πŸš€ πŸ—³ 6μ›” 25일 FSCalend

Native and encrypted password manager for iOS and macOS.
Native and encrypted password manager for iOS and macOS.

Open Sesame Native and encrypted password manager for iOS and macOS. What is it? OpenSesame is a free and powerful password manager that lets you mana

APT repository app for jailbroken iOS devices
APT repository app for jailbroken iOS devices

Find Your Repos! RepoFinder is here to bring you a seamless way to add all of your favorite repositories right into the package manager of your choice

Apple's iOS Private Frameworks
Apple's iOS Private Frameworks

iOS Private Framework This repo contains reversed-engendered private frameworks used by Apple in iOS. Private frameworks are frameworks which you are

SuccessorCLI A CLI tool to restore iOS Devices on versions they're already on, based on the original Succession

A tool to restore iOS Devices on versions they're already on, based on the original Succession

Fugu14 is an iOS 14 Jailbreak, including an untether (persistence), kernel exploit, kernel PAC bypass and PPL bypass.

Fugu14 - Untethered iOS 14 Jailbreak Fugu14 is an (incomplete) iOS 14 Jailbreak, including an untether (persistence), kernel exploit, kernel PAC bypas

Comments
  • Not work in Xcode 11.4 and iOS 13

    Not work in Xcode 11.4 and iOS 13

    Hi, I try to use your library in my project. Unfortunately Xcode show me this error: "cannot build module SAPinViewController obj .c"

    It seems SnapKit do not support the latest swift version. Can someone confirm?

    opened by ghost 0
Owner
Siavash
Siavash
Oversecured Vulnerable iOS App is an iOS app that aggregates all the platform's known and popular security vulnerabilities.

Description Oversecured Vulnerable iOS App is an iOS app that aggregates all the platform's known and popular security vulnerabilities. List of vulner

Oversecured Inc 135 Dec 15, 2022
Pass for iOS - an iOS client compatible with Pass command line application.

Pass is an iOS client compatible with ZX2C4's Pass command line application. It is a password manager using GPG for encryption and Git for version control.

Mingshen Sun 1.3k Dec 26, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

null 3.3k Dec 30, 2022
Safe and easy to use crypto for iOS and macOS

Swift-Sodium Swift-Sodium provides a safe and easy to use interface to perform common cryptographic operations on macOS, iOS, tvOS and watchOS. It lev

Frank Denis 483 Jan 5, 2023
Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS.

Helper functions for storing text in Keychain for iOS, macOS, tvOS and WatchOS This is a collection of helper functions for saving text and data in th

Evgenii Neumerzhitckii 2.3k Dec 28, 2022
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.

KeychainAccess KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much mor

Kishikawa Katsumi 7.2k Dec 30, 2022
A simple Swift Keychain Wrapper for iOS, watchOS, and OS X.

Latch A simple Swift 2.0 Keychain Wrapper for iOS, watchOS 2, and OS X. Usage A proper example of how to use Latch can be seen in the tests. import La

Danielle 56 Oct 25, 2022
A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.

SwiftKeychainWrapper A simple wrapper for the iOS / tvOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift. Prov

Jason 1.5k Dec 30, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022