title: Why is my Progress HUD not displaying as expected
body: <p>I'm trying to develop a 'passwordless' registration form using a QRCode. The background processing works (can authenticate user), but noting happens visually until the registration is complete and the user is redirected to the apps main ViewController, however,   A progress dialog with spinner is supposed to appear during the registration process but it doesn't.  If, I manually input the credentials and press 'authenticate', everything works as expected, Just not after scanning the QR code.  </p>
  
  <p>Please see code below:</p>
  
  <pre><code>@interface ViewControllerRegister (){
      JGProgressHUD *HUD;
      NSString *regid;
      NSString *regpin;
  
      NSMutableDictionary *dicto;
  }
  
  
  
  //OPEN QRCODE READER VC
  
  - (IBAction)scanAction:(id)sender
  {
    if ([QRCodeReader supportsMetadataObjectTypes:@[AVMetadataObjectTypeQRCode]]) {
      static QRCodeReaderViewController *vc = nil;
      static dispatch_once_t onceToken;
  
      dispatch_once(&amp;onceToken, ^{
        QRCodeReader *reader = [QRCodeReader readerWithMetadataObjectTypes:@[AVMetadataObjectTypeQRCode]];
        vc                   = [QRCodeReaderViewController readerWithCancelButtonTitle:@"Cancel" codeReader:reader startScanningAtLoad:YES];
        vc.modalPresentationStyle = UIModalPresentationFormSheet;
      });
      vc.delegate = self;
      [vc setCompletionWithBlock:^(NSString *resultAsString) {
      //  NSLog(@"Completion with result: %@", resultAsString);
  
      }];
  
  
  
      [self presentViewController:vc animated:YES completion:NULL];
    }
    else {
        [self showAlert:@"Reader not supported by the current device"];
    }
  }
  
  
  
  
  //// PARSE THE RETURNED QR CODE DATA
  #pragma mark - QRCodeReader Delegate Methods
  
  - (void)reader:(QRCodeReaderViewController *)reader didScanResult:(NSString *)result
  {
    [self dismissViewControllerAnimated:YES completion:^{
  
      NSURL *stringfromscan = [NSURL URLWithString:result];
  
              dicto = [NSMutableDictionary new];
  
             NSURLComponents *components = [NSURLComponents componentsWithURL:stringfromscan resolvingAgainstBaseURL:NO];
             NSArray *queryItems = [components queryItems];
  
  
  
             for (NSURLQueryItem *item in queryItems)
             {
                 [dicto setObject:[item value] forKey:[item name]];
             }
  
  
  
        if ([result rangeOfString:@"eloq"].location == NSNotFound &amp;&amp; [result rangeOfString:@"unique"].location == NSNotFound) {
  
            [self showAlert:@"Looks like you've scanned an incorect QR code"];
  
          } else {
  
  
              self.TextViewUniqueID.text = [dicto objectForKey:@"uniqueid"];
              self.TextViewPIN.text = [dicto objectForKey:@"password"];
  
  
              double delayInSeconds = 1.0;
              dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
              dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
                      [self authent];
  
              });
  
  
          }
    }];
  }
  
  
  
  
  
  /// CREDENTIAL VALIDATION OF SORTS
  
  - (void)authent{
        NSLog(@"s UNIQUEID %@", self.TextViewUniqueID.text);
        NSLog(@"PIN %@", self.TextViewPIN.text);
      //  [self resignFirstResponder];
  
  
        int uniqueID = [self.TextViewUniqueID.text length];
        int PIN = [self.TextViewPIN.text length];
  
  
        if (uniqueID &lt; 7  ||  PIN &lt; 6){
  
  
            UIAlertController* alert = [UIAlertController  alertControllerWithTitle:@"Error!"
                                                                           message:@"Your UniqueID or PIN is too short."
                                                                    preferredStyle:UIAlertControllerStyleAlert];
  
            UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"Try Again" style:UIAlertActionStyleDefault
                                                                  handler:^(UIAlertAction * action) {}];
  
            [alert addAction:defaultAction];
            [self presentViewController:alert animated:YES completion:nil];
  
  
            [self clear];
  
        }else{
  
            /*
  
              HUD WILL NOT DISPLAY AFTER READING QR CODE
  
  
            */ 
            HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
            HUD.textLabel.text = @"Authenticating";
            [HUD showInView:self.view];
  
            [self PostJson:self.TextViewUniqueID.text :self.TextViewPIN.text];
  
        }
  }
  </code></pre>