Support for forcing animated menu dismissal even when pushed view controllers are not animated.

This commit is contained in:
jonkykong
2017-10-26 18:08:43 -07:00
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -127,6 +127,9 @@ open class SideMenuManager : NSObject {
*/
open var menuDismissOnPush = true
/// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation.
open var menuAlwaysAnimate = false
/// Default instance of SideMenuManager.
open static let `default` = SideMenuManager()
internal var transition: SideMenuTransition!
@@ -267,6 +267,8 @@ open class UISideMenuNavigationController: UINavigationController {
// is dismissed after showing the appropriate screen
CATransaction.begin()
if sideMenuManager.menuDismissOnPush {
let animated = animated || sideMenuManager.menuAlwaysAnimate
CATransaction.setCompletionBlock( { () -> Void in
activeDelegate?.sideMenuDidDisappear(menu: self, animated: animated)
if !animated {