0

When I use [SVProgressHUD show], delay 2 seconds, then use [SVProgressHUD dismiss], the HUD dismiss.

But when I use [SVProgressHUD showErrorWithStatus:@"test"], the hud can' show.

Can someone stay me why?

  - (void)viewDidLoad {
       [super viewDidLoad];
       [SVProgressHUD show]; 
       dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [SVProgressHUD dismiss]; 
            [SVProgressHUD showErrorWithStatus:@"test"]; 
       });
   }
Dharma
  • 3,007
  • 3
  • 23
  • 38
CveniEs
  • 3
  • 3

2 Answers2

0

The SVProgressHUD.showInfoWithStatus will hide the message after some time. so probably second HUD won't show cause it is still remove the first one. [SVProgressHUD show];

If you wanna update don't call dismiss [SVProgressHUD dismiss];

Dharma
  • 3,007
  • 3
  • 23
  • 38
  • but the old version of SVProgressHUD don't have this issue, I read the source code, can't find any different between the new and old version – CveniEs Jul 07 '17 at 07:54
0

Remove the line:

[SVProgressHUD dismiss];

Use only:

[SVProgressHUD showErrorWithStatus:@"test"];

I think this is helpful for you.

Nikunj Gangani
  • 224
  • 2
  • 10