小编Bla*_*nge的帖子

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

我想在我的应用程序中使用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) { …
Run Code Online (Sandbox Code Playgroud)

landscape fingerprint ios8

4
推荐指数
1
解决办法
723
查看次数

标签 统计

fingerprint ×1

ios8 ×1

landscape ×1