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.