2014-12-12 2 views
0

취소를 누르고 [buttonTouch setHidden:NO];을 표시하면 버튼이 즉시 나타나지 않고 작동하는 데 너무 오랜 시간이 걸립니다.TouchID 호출 방법으로 인증 한 후 작동하지 않습니다.

내 코드 :

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"); 
      } 
     }]; 

답변

1

전화

dispatch_async(dispatch_get_main_queue(), ^{ 

       [buttonTouch setHidden:NO]; 

      }); 
관련 문제