Skip to content

Commit

Permalink
handsomecode#95 - fixed the delay when side menu needed to close
Browse files Browse the repository at this point in the history
  • Loading branch information
mayoralito committed Jul 7, 2019
1 parent 47bdc88 commit 8e1af5d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/MenuContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,20 @@ fileprivate extension MenuContainerViewController {
if menuViewController == nil {
fatalError("Invalid `menuViewController` value. It should not be nil")
}
present(menuViewController, animated: true, completion: nil)
DispatchQueue.main.async { [weak self] in
guard let menuViewController = self?.menuViewController else { return }
self?.present(menuViewController, animated: true, completion: nil)
}
isShown = true
}

/**
Dismisses left side menu.
*/
func dismissNavigationMenu() {
self.dismiss(animated: true, completion: nil)
DispatchQueue.main.async { [weak self] in
self?.dismiss(animated: true, completion: nil)
}
isShown = false
}
}
Expand Down

0 comments on commit 8e1af5d

Please sign in to comment.