Finger Touch Authentication For iOS

TouchID

iOS8 TouchID with just few lines of code

Default

Usage

Without Cocoapods

Add TouchID.swift to your project.

Examples

Initializing and adding the switch to the screen

@IBOutlet var touchAuthentication: TouchID! = TouchID.sharedInstance

Check whether a passcode is set for your application or not with touchAuthentication.isPasscodeSetup(). If not set, then setup it with touchAuthentication.setupPassword() and for using device Touch Finger usetouchAuthentication.authenticateUser().

if !touchAuthentication.isPasscodeSetup() {
touchAuthentication.setupPassword()
}else{
touchAuthentication.authenticateUser()
}

Define TouchIDDelegate Delegate to get all the success and fail responses.

class ViewController: UIViewController, TouchIDDelegate

touchAuthentication.touchDelegate = self

Delegate Methods (All are optional)

func TouchIDSuccedd()
func TouchIDFail(ErrorMessage: String)
func PasscodeSuccedd()
func PasscodeFail(ErrorMessage: String)
func SetUpPasscodeSuccedd()
func SetUpPasscodeFail(ErrorMessage: String)
func ChangePasscodeSuccedd()
func ChangePasscodeFail(ErrorMessage: String)
func SetingsPopUpResponse(Message: String)

Use like

//MARK:- TouchIDDelegate

func TouchIDSuccedd() {
// Implementation After Authentication Pass
}

func TouchIDFail(ErrorMessage: String) {
// Authentication Fail/Error
print("\(ErrorMessage)")
}

Swift and Objective-C compatability

TouchID uses Swift as of its 3.0 release. TouchID.swift can be used in Objective-C using Swift Objective-C bridging.

Requirements

TouchID requires iOS 8.0 and above.

Code:

touchid_1touchid_2touchid_3touchid_4touchid_5touchid_6touchid_7

Usage:

touchid_8touchid_9

Repositoryhttps://github.com/kapilahuja-systematix/touchid

Advertisements
Finger Touch Authentication For iOS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s