Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

AntonBelousov/BiometryAuthUI

Open more actions menu

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.