swift 指纹识别
2016-03-07 10:16
471 查看
func touAc(){
let laContext =
LAContext()
var error :
NSError?
let letview =
UIAlertView(title: "指纹验证", message:
"ok", delegate: nil, cancelButtonTitle:
"确认", otherButtonTitles:
"取消")
let errorReason =
"请输入指纹"
if laContext.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics,error:&error)
{
laContext.evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics,
localizedReason: errorReason, reply: { (success, errore) -> Void
in
if success{
print("ok======!!!!!")
dispatch_async(dispatch_get_main_queue(), {
//需要主线程执行的代码
letview.show()
})
}
else{
print("\(errore)====ahahahhaha")
}
})
}
}
let laContext =
LAContext()
var error :
NSError?
let letview =
UIAlertView(title: "指纹验证", message:
"ok", delegate: nil, cancelButtonTitle:
"确认", otherButtonTitles:
"取消")
let errorReason =
"请输入指纹"
if laContext.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics,error:&error)
{
laContext.evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics,
localizedReason: errorReason, reply: { (success, errore) -> Void
in
if success{
print("ok======!!!!!")
dispatch_async(dispatch_get_main_queue(), {
//需要主线程执行的代码
letview.show()
})
}
else{
print("\(errore)====ahahahhaha")
}
})
}
}
相关文章推荐
- swift版本拼图游戏项目源码
- Swift泛型
- Swift CAShapeLayer,UIBezierPath绘制图形
- iOS - Swift - 图书展示项目
- Swift图书展示项目笔记
- Swift构造函数
- dyld: Library not loaded: @rpath/libswiftCore.dylib 错误的解决
- Swift 之 RxSwift
- iOS开发--Swift RAC响应式编程
- OC Swift 混编
- iOS - Swift - 语法糖
- swift : NSData数据类型与String字符串类型的转换方法
- swift空间位置,大小改变的动画效果
- swift之自定义表格控件(UITableView)
- swift 调用第三方的oc 方法
- Swift - 时间控制器NSTimer(每隔一定时间执行某个函数)
- Swift 继承Inheritance
- swift:CoreData简单入门(增加、查询、修改、删除)(详细讲解)
- How to create a pure Swift module
- swift基本语法