Giter Site home page Giter Site logo

antonbelousov / biometryauthui Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 77 KB

This is a ready-to-use UI for working with touchID/faceID/pincode auth

License: MIT License

Ruby 1.79% Swift 11.45% C 1.25% Objective-C 85.50%
ios biometry touch-id touchid-authentication touchid-ui touchid faceid faceid-authentication faceid-ui pincode authentication auth login

biometryauthui's Introduction

BiometryAuthUI

This is a ready-to-use UI for working with touchID/faceID/pincode auth

Installation

pod 'BiometryAuthUI'

Usage

NOTE. The app's Info.plist must contain an NSFaceIDUsageDescription key with a string value explaining to the user how the app uses this data plist

Set passcode


// delete current passcode if needed
// let service = KeychainPasscodeService()
// service?.deletePasscode()

// BiometryUIModule will use your localization (see Example/BiometryExample.xcworkspace)
BiometryUIModule.shared().localizationTable = "Localization"

let vc = NewPasscodeViewController()
vc.tintColor = UIColor.red
vc.backgroundColor = UIColor.white
vc.passcodeCompletionBlock = {
    [weak self] in
    self?.dismiss(animated: true, completion: {
        [weak self] in
        let alert = UIAlertController(title: "Passcode created", message: nil, preferredStyle: .alert)
        alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
        self?.present(alert, animated: true, completion: nil)
    })
}
self.present(vc, animated: true, completion: nil)

set passcode

Authorization

BiometryUIModule.shared().localizationTable = "Localization"
        
let vc = LoginViewController()
vc.tintColor = UIColor.white
vc.backgroundColor = UIColor.black
vc.shouldAskForBiometryOnDidAppear = true
vc.successCompletionBlock = {
    [weak self] in
    self?.dismiss(animated: true, completion: {
        self?.dismiss(animated: true, completion: {
            [weak self] in
            let alert = UIAlertController(title: "Success auth", message: nil, preferredStyle: .alert)
            alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
            self?.present(alert, animated: true, completion: nil)
        })
    })
}
self.present(vc, animated: true, completion: nil)

auth_faceid auth_passcode auth_touchid

biometryauthui's People

Contributors

antonbelousov avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

strategist922

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.