swift - 在 Swift 3 中使用未解析的标识符 'LAContext'

标签 swift xcode touch-id

Apple 声称他们的武器库中有此类 LAContext ,但 Xcode 8.1 告诉我:Use of unresolved identifier 'LAContext'

我的代码行如下:

let context = LAContext()

对我来说,这行代码并没有接缝到疯狂 ;),所有在线教程都使用它来检查是否启用了 TouchID 没问题,但在我的 Xcode 中,情况并非如此。

我错过了什么?

最佳答案

您需要导入包含此类和其他相关功能的 LocalAuthentication 框架。

import LocalAuthentication

关于swift - 在 Swift 3 中使用未解析的标识符 'LAContext',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40871102/

相关文章:

ios - 导入 LocalAuthentification.framework 在 iOS 7.1 上崩溃

ios - 当我从另一个 View 中退出时,Touch ID 自动触发成功

swift - 您如何对具有您不关心的关联值的枚举案例进行简单的在线测试?

objective-c - 使 Spotlight 搜索栏像 Objc/Swift 中的 View 一样

xcode - 打开应用程序并从 URL 执行功能

ios - 获取 iOS 密码自动填充以使用 "change password"页面

swift - 如何在 NSTextView 中捕获 Alt + 向上箭头事件

ios - 在 RxSwift 中从 searchBar 绑定(bind)到 TableView

xcode - 告诉 Xcode 不要在项目上使用自动布局

ios - Touch ID指纹识别