我已经使用 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)")
}
}
}
最佳答案
设置 localizedFallbackTitle 属性:
objective-C :
LAContext *context = [[LAContext alloc] init];
context.localizedFallbackTitle = @"YOUR TEXT HERE";
swift :
var touchIDContext = LAContext()
context.localizedFallbackTitle = "YOUR TEXT HERE"
关于ios - LAContext 更改 UIAlertController 按钮标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28095562/