Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MBProgressHUD Block interface until operation is done

I need to block the interface until the MBProgressHUD operation is done. I did refer this thread,

Block interface until operation is done

According to it, we should disable each individual item which wont work for me. My case is I need to disable user from clicking back button. I did try HUD.userInteractionEnabled = YES which disable every controller except the back button. Is there any way of blocking user from popping out from that controller?

Regards,
Dilshan

like image 595
Dilshan Avatar asked Jul 16 '12 12:07

Dilshan


2 Answers

if u dont find a proper way to do that, you can ignore the whole user interaction by

[[UIApplication sharedApplication] beginIgnoringInteractionEvents];

.U can stop this by

[[UIApplication sharedApplication] endIgnoringInteractionEvents];
like image 63
sujith1406 Avatar answered Sep 28 '22 05:09

sujith1406


You can add the MBProgressHUD to the navigation controller's view so that it also prevents interaction with the back button:

[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
like image 44
ToddH Avatar answered Sep 28 '22 03:09

ToddH