我已使用LAContext
将TouchID合并到我的应用中,如下所示:
但是,我想要从“输入密码”更改按钮标题的名称,进入“输入安全码”(或类似的东西),如下所示:
如何更改该按钮标题?
以下是LAContext
documentation,这是我的代码:
var touchIDContext = LAContext()
if touchIDContext.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &msgError) {
touchIDContext.evaluatePolicy(.DeviceOwnerAuthenticationWithBiometrics, localizedReason: touchIDMessage) {
(success: Bool, error: NSError!) -> Void in
if success {
println("Success")
} else {
println("Error: \(error)")
}
}
}
答案 0 :(得分:12)
设置localizedFallbackTitle属性:
目标-C:
LAContext *context = [[LAContext alloc] init];
context.localizedFallbackTitle = @"YOUR TEXT HERE";
夫特:
var touchIDContext = LAContext()
context.localizedFallbackTitle = "YOUR TEXT HERE"
答案 1 :(得分:2)
从Apple文档中,{10}可用于iOS 10
localizedCancelTitle