qmathe / DropDownMenuKit

UIKit drop down menu, simple yet flexible and written in Swift
Other
302 stars 38 forks source link

issue when working with MBProgressHUD #28

Closed 1037390459 closed 5 years ago

1037390459 commented 5 years ago

on cell.menuAction selector like this: func choose(_ sender: AnyObject) { titleView.toggleMenu() showHud(); hideHud(); } and the dropMenu animation will be strange.

qmathe commented 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:

Here is a screenshot:

Simulator Screen Shot - iPhone Xʀ - 2019-05-02 at 16 34 07

qmathe commented 5 years ago

I'm closing this issue. If it's still a problem, please let me know.