EHFAuthenticator-Touch-ID 0.0.4

EHFAuthenticator-Touch-ID 0.0.4

测试已测试
Lang语言 Obj-CObjective C
许可协议 MIT
released最新发布2015年10月

Chris Truman 维护。




EHFAuthenticator

用于处理本地认证的简单类,使用 Touch ID。用于 eHarmony iOS App。EHF 代表 eHarmony Foundation,这是我们基于 Apple 框架构建的实用程序库。仅适用于 iOS 8,因为它需要 LocalAuthentication 框架。只在配备 Touch ID 传感器的设备上功能正常(iPhone 5S、6、6+)。在模拟器上无法使用。

目前支持 Swift 1.2 语法。当 Xcode 7 正式发布时,将更新到 Swift 2.0。

关于功能的文章 在 medium 上

我们展示 eHarmony 中该功能的截图如下: mockup

示例用法

使用 Cocoapods 安装

pod 'EHFAuthenticator-Touch-ID', '0.0.3'

设置一个理由向用户显示,然后进行认证以验证身份。

ObjC

[[EHFAuthenticator sharedInstance] setReason:@"Authenticate with Touch ID to access secure data"]
[[EHFAuthenticator sharedInstance] authenticateWithSuccess:^(){
    // Success
} andFailure:^(LAError errorCode){
  //Handle LAError codes.  See example project for the different errors that can occur.
}];

Swift

EHFAuthenticator.sharedInstance.reason = "Authenticate with Touch ID to access secure data"
EHFAuthenticator.sharedInstance.authenticateWithSuccess({
    // Success
}, failure:{ errorCode in
  //Handle LAError codes.  See example project for the different errors that can occur.
})