Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MBProgressHUD blocking user interaction

My application has a MBProgressHUD on the screen while the CLLocationManager is getting the user current location at a separate thread in the background. Sometimes the location process start to take so long and obviously I would like to let the user decide to leave or not the screen. The problem is that the User Interface seems to be blocked by the MBProgressHUD so the user can't press the back button.

Is there any implementation design to solve this problem?

like image 859
vilelam Avatar asked Jan 27 '13 18:01

vilelam


1 Answers

In order to achieve a non-modal behavior, simply disable the user interaction on the MBProgressHUD so that the touches will fall through it.

Objective-C

theHUD.userInteractionEnabled = NO;

Swift 4.x

theHUD.isUserInteractionEnabled = false
like image 107
Gabriele Petronella Avatar answered Sep 28 '22 10:09

Gabriele Petronella