LAContext更改UIAlertController按钮标题

Cod*_*ton 7 ios touch-id swift uialertcontroller

我已将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)")
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Pau*_*nne 12

设置localizedFallbackTitle属性:

Objective-C的:

LAContext *context = [[LAContext alloc] init];
context.localizedFallbackTitle = @"YOUR TEXT HERE";
Run Code Online (Sandbox Code Playgroud)

迅速:

var touchIDContext = LAContext()
context.localizedFallbackTitle = "YOUR TEXT HERE"
Run Code Online (Sandbox Code Playgroud)