ios8 - 如何在横向模式下使用 Touch ID?

标签 ios8 landscape fingerprint

我想在我的仅处于横向模式的应用程序中使用 Touch ID。一切正常,但身份验证警报仅在纵向模式下显示。我该怎么办?
这是我的代码:

LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = [[NSString alloc] initWithUTF8String: title];

if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
         [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                   localizedReason:myLocalizedReasonString
                             reply:^(BOOL success, NSError *error) {
                                 if (success) {
                                     // User authenticated successfully, take appropriate action
                                     NSLog(@"Authenticated using Touch ID.");
                                     //do something
                                 } else {
                                     // User did not authenticate successfully, look at error and take appropriate action
                                     if (authError.code == kLAErrorUserFallback) {
                                         NSLog(@"User tapped Enter Password");
                                     } else if (authError.code == kLAErrorUserCancel) {
                                         NSLog(@"User tapped Cancel");
                                     } else {
                                         NSLog(@"Authenticated failed.");
                                     }
                                 }
                             }];
} else {
    // Could not evaluate policy; look at authError and present an appropriate message to user
    NSLog(@"Touch ID is not available: %@", authError);
}

最佳答案

App Store 应用程序确实旋转了 Touch ID 警报,但它似乎是一个黑客。

当您旋转设备时(我尝试使用 6+),您会看到灰色 alpha 蒙版与 Touch ID 警报一起旋转。他们可能正在对 View 应用转换,但我还没有弄清楚如何到达该 View 。

XCode UI 检查器在运行时不会在 View 层次结构中显示 Touch ID 对话框。可以理解,因为它在一个单独的进程中运行。

编辑:我将其与测试应用程序一起报告给 Apple。 RadarWeb 错误 ID 19893424

关于ios8 - 如何在横向模式下使用 Touch ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26989332/

相关文章:

iphone - 使用 iPhone 5s 中提供的指纹扫描仪在我们的应用程序中进行授权

android - 适用于 Android 的 Google Maps API,获取 SHA1 证书而不是 MD5

json - swift三层嵌入json数据

iOS 8 核心数据堆栈 - fatal error : found nil while unwrapping an Optional value

ios - 为什么我不能在 Swift 中调用 UIViewController 上默认的 super.init() ?

iphone - 滚动、缩放 UIScrollView 和界面方向旋转。如何使用自动调整大小等

codenameone - 指纹认证代号一

ios - 我怎样才能制作表情符号或输入任何内容

ios - 横向需要一些 Controller

ios - 如何在横向 SwiftUI 的 Master-Detail1-Detail2 View 中显示缺少的后退按钮?