Latest 1.0.2
Homepage https://github.com/Mustafa-Ezzat/FaceID
License MIT
Platforms ios 11.2
Authors

Local auth through Touch ID or Face ID

Install

manual

by drag the LocalAuth.swift file from /Source forlder to your project

cocoapods

pod ‘FaceID’

cocoapods tutorial: https://cocoapods.org

Usage

import UIKit

import FaceID

class LocaLAuthViewController: BaseViewController {

// BaseViewController inherit from UIViewController

let localAuth = LocalAuth()

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    localAuth.delegate = self
}

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    localAuth.checkAuthentication()
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

}

extension LocaLAuthViewController: LocalAuthDelegate
{

func pass() {
    // code for path here
    print("Pass...")
}

func fail() {
    // code for fail here
    print("Fail...")
}

func noSupported() {
    // code if your device not support touch id or face id here
    print("Not supported...")
}

}

Test on simulators

I don’t have iPhone-X, don’t worry :)

Test Face ID on iPhone-X simulator

1- run your app on iPhone-X simulator and enable face id

Alt text

2- test matching

Alt text

3- test not matching

Alt text

Test Touch ID on iPhone-6s simulator

1- run your app on iPhone-6s simulator and enable touch id

Alt text

2- test matching

Alt text

3- test not matching

Alt text

Have a nice day :)

Latest podspec

{
    "name": "FaceID",
    "version": "1.0.2",
    "summary": "For Local auth",
    "description": "Auth through Touch ID or Face ID!",
    "homepage": "https://github.com/Mustafa-Ezzat/FaceID",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Mustafa Ezzat": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Mustafa-Ezzat/FaceID.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "11.2"
    },
    "source_files": "Source/LocalAuth.swift"
}

Pin It on Pinterest

Share This