0

キャンセルを押し[buttonTouch setHidden:NO];て表示するように設定すると、認証を行った後、ボタンイベントが機能しているにもかかわらず、ボタンがすぐに表示されず、表示に時間がかかりすぎます。

私のコード:

if ([context canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]){
        NSLog(@"TouchID Available!");

        [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"Authenticate for server login" reply:^(BOOL success, NSError *authenticationError){
            if (success) {
                [self dismissViewControllerAnimated:YES completion:nil];
                //[self VerifyUserInfo:YES];
                NSLog(@"Fingerprint validated.");
            }else{
                NSLog(@"Fingerprint validation failed: %@.", authenticationError.localizedDescription);
                switch (authenticationError.code) {
                    case LAErrorAuthenticationFailed:
                        [self AlertsMessage:@"Authentication is failed"];
                        NSLog(@"Authentication Failed");
                        break;

                    case LAErrorUserCancel:
                        [buttonTouch setHidden:NO];
                        NSLog(@"User pressed Cancel button");
                        break;

                    case LAErrorUserFallback:
                        [buttonTouch setHidden:NO];
                        NSLog(@"User pressed \"Enter Password\"");
                        break;

                    default:
                        [self AlertsMessage:@"Touch ID is not configured"];
                        NSLog(@"Touch ID is not configured");
                        break;
                }

                NSLog(@"Authentication Fails");
            }
        }];
4

1 に答える 1

1

電話

 dispatch_async(dispatch_get_main_queue(), ^{

                [buttonTouch setHidden:NO];

            });
于 2014-12-12T11:56:24.443 に答える