jdg / MBProgressHUD

MBProgressHUD + Customizations
http://www.bukovinski.com/
MIT License
16.01k stars 3.56k forks source link

Issue MBProgressHUD userInteractionEnabled #305

Closed tenaz3 closed 8 years ago

tenaz3 commented 9 years ago

This code below set user interaction true, but disable user touch events. It seems that do inverted work. Is this correct? The doc say:

    var userInteractionEnabled: Bool // default is YES. if set to NO, user events (touch, keys) are ignored and removed from the event queue.
    func startLoading() {
           let loading = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
           loading.mode = MBProgressHUDMode.Indeterminate
           loading.labelText = Strings.Loading
           loading.userInteractionEnabled = true
    }
fmendoza commented 9 years ago

I have the same doubt...

matej commented 9 years ago

Setting userInteractionEnabled = true means that the HUD receives touches. This in turn means that it prevents touches from passing through it to other views. Setting userInteractionEnabled = false makes the hud opaque to touches, meaning that they pass through it to views that are positioned below it.