Skip to content

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

License

Notifications You must be signed in to change notification settings

AntonBelousov/BiometryAuthUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy