最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
iOS开发中Swift 指纹验证功能模块实例代码
时间:2017-07-10 编辑:简简单单 来源:一聚教程网
iOS调用TouchID代码:
代码如下 | 复制代码 |
override func viewDidLoad() { super.viewDidLoad() let context = LAContext() var error: NSError? = nil let canEvaluatePolicy = context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) as Bool iferror != nil { print(error!.localizedDescription as String) } ifcanEvaluatePolicy { print("有指纹验证功能") context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason:"放上您的狗爪", reply: { (success: Bool, error: Error?) in ifsuccess { print("验证成功") }else{ print("验证失败: \(error?.localizedDescription)") } }) }else{ print("还没开启指纹验证呢") } } |
相关文章
- sora软件价格介绍 02-22
- sora官网入口地址一览 02-22
- Sora生成的视频使用教程 02-22
- 《梦幻西游》元宵灯谜线索答案大全2024 02-22
- 《原神》有朋自远方来第一天通关攻略 02-22
- 《苏醒之路》四个结局达成攻略 02-22