我将TouchID与LAContext合并到我的应用程序中,如下所示:

但是,我希望将按钮标题的名称从“输入密码”更改为“输入安全代码”(或类似的内容),如下所示:

我该怎么改变那个按钮的标题呢?
这是LAContext 文档,这是我的代码:
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)")
}
}
}发布于 2015-01-22 18:01:16
设置localizedFallbackTitle属性:
目标-C:
LAContext *context = [[LAContext alloc] init];
context.localizedFallbackTitle = @"YOUR TEXT HERE";斯威夫特
var touchIDContext = LAContext()
context.localizedFallbackTitle = "YOUR TEXT HERE"发布于 2016-10-19 07:17:02
从苹果文档中,localizedCancelTitle可用于iOS 10
// Fallback button title.
// @discussion Allows fallback button title customization. A default title "Enter Password" is used when
// this property is left nil. If set to empty string, the button will be hidden.
@property (nonatomic, nullable, copy) NSString *localizedFallbackTitle;
// Cancel button title.
// @discussion Allows cancel button title customization. A default title "Cancel" is used when
// this property is left nil or is set to empty string.
@property (nonatomic, nullable, copy) NSString *localizedCancelTitle NS_AVAILABLE(10_12, 10_0);https://stackoverflow.com/questions/28095562
复制相似问题