vilelam
vilelam

Reputation: 804

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?

Upvotes: 36

Views: 10365

Answers (1)

Gabriele Petronella
Gabriele Petronella

Reputation: 108101

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

Upvotes: 71

Related Questions