Closed 1037390459 closed 5 years ago
Hi,
I modified ViewController.choose(_:)
in the project example and MBProgressHUD seems to be working fine:
@IBAction func choose(_ sender: AnyObject) {
titleView.title = (sender as! DropDownMenuCell).textLabel!.text
// Don't show HUD on initial selection (see selectCell() in prepareNavigationBarMenu())
guard !navigationBarMenu.isHidden else { return }
guard let navigationView = self.navigationController?.view else { return }
let hud = MBProgressHUD.showAdded(to: navigationView, animated: true)
DispatchQueue.global(qos: .background).async {
sleep(3)
DispatchQueue.main.async {
hud.hide(animated: true)
}
}
)
You might want to check the following points:
DropDownMenu
view (e.g. root view or navigation view), otherwise the HUD won't prevent user touches to be sent to the menu
hideHUD()
immediately after showHUD()
without any delay to ensure the animation looks goodHere is a screenshot:
I'm closing this issue. If it's still a problem, please let me know.
on cell.menuAction selector like this: func choose(_ sender: AnyObject) { titleView.toggleMenu() showHud(); hideHud(); } and the dropMenu animation will be strange.