如何在横向模式下使用TouchID?

Bla*_*nge 4 landscape fingerprint ios8

我想在我的应用程序中使用TouchID,仅在横向模式下.一切正常,但身份验证警报仅在纵向模式下显示.我该怎么办?

这是我的代码:

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);
}
Run Code Online (Sandbox Code Playgroud)

Mar*_*oie 5

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

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

XCode UI检查器在运行时不会在视图层次结构中显示"触摸ID"对话框.可以理解,因为它在一个单独的过程中运行.

编辑:我向Apple报告了测试应用程序.RadarWeb bug ID 19893424