Skip to content

Commit 8e1af5d

Browse files
committed
handsomecode#95 - fixed the delay when side menu needed to close
1 parent 47bdc88 commit 8e1af5d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/MenuContainerViewController.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,20 @@ fileprivate extension MenuContainerViewController {
177177
if menuViewController == nil {
178178
fatalError("Invalid `menuViewController` value. It should not be nil")
179179
}
180-
present(menuViewController, animated: true, completion: nil)
180+
DispatchQueue.main.async { [weak self] in
181+
guard let menuViewController = self?.menuViewController else { return }
182+
self?.present(menuViewController, animated: true, completion: nil)
183+
}
181184
isShown = true
182185
}
183186

184187
/**
185188
Dismisses left side menu.
186189
*/
187190
func dismissNavigationMenu() {
188-
self.dismiss(animated: true, completion: nil)
191+
DispatchQueue.main.async { [weak self] in
192+
self?.dismiss(animated: true, completion: nil)
193+
}
189194
isShown = false
190195
}
191196
}

0 commit comments

Comments
 (0)