1

I am using SVProgressHUD as an activity indicator in my project. I don't want to show HUD if my data loads faster than 3 seconds, it should show only after this time period. I am not able to delay the loading of SVProgress HUD.

Bowdzone
  • 3,827
  • 11
  • 39
  • 52
jayant rawat
  • 318
  • 2
  • 12

1 Answers1

2

Use following code :

  [self performSelector:@selector(addHUD) withObject:nil afterDelay:3.0f];

If data loads before 3 sec call

 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(addHUD) object:nil];

Also add above line in dealloc method.

user4261201
  • 2,324
  • 19
  • 26
Aruna Mudnoor
  • 4,795
  • 14
  • 16