gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 01:02:07 24 4
gpt4 key购买 nike

我想在我的仅处于横向模式的应用程序中使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com