1

I tried to add a UIGestureRecognizer to hide the HUD when the user touches it. This is my code:

let gesture = UITapGestureRecognizer(target: self, action: #selector(someAction(_:)))
PKHUD.sharedHUD.contentView.userInteractionEnabled = true
PKHUD.sharedHUD.contentView.addGestureRecognizer(gesture)

// ...

func someAction(sender:UITapGestureRecognizer){
    // do task
}

But someAction is never called when touching the HUD. Any ideas how to hide the PKHUD? I know, there is a HUD.hide() method, but I want the user to decide when the view should disappear.

mixable
  • 1,068
  • 2
  • 12
  • 42

1 Answers1

0

Try to use:

PKHUD.sharedHUD.dimsBackground: Bool