diff --git a/Pod/Classes/SideMenuManager.swift b/Pod/Classes/SideMenuManager.swift index 9558c1eb..83bbe3f9 100644 --- a/Pod/Classes/SideMenuManager.swift +++ b/Pod/Classes/SideMenuManager.swift @@ -93,6 +93,9 @@ open class SideMenuManager : NSObject { /// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true. open static var menuFadeStatusBar = true + /// When true, pushViewController called within the menu it will push the new view controller inside of the menu. Otherwise, it is pushed on the menu's presentingViewController. Default is false. + open static var menuAllowSubmenus: Bool = false + /// -Warning: Deprecated. Use `menuAnimationTransformScaleFactor` instead. @available(*, deprecated, renamed: "menuAnimationTransformScaleFactor") open static var menuAnimationShrinkStrength: CGFloat { diff --git a/Pod/Classes/UISideMenuNavigationController.swift b/Pod/Classes/UISideMenuNavigationController.swift index 5a3f6210..e782da55 100644 --- a/Pod/Classes/UISideMenuNavigationController.swift +++ b/Pod/Classes/UISideMenuNavigationController.swift @@ -132,6 +132,11 @@ open class UISideMenuNavigationController: UINavigationController { return } + if SideMenuManager.menuAllowSubmenus{ + super.pushViewController(viewController, animated: true) + return + } + // to avoid overlapping dismiss & pop/push calls, create a transaction block where the menu // is dismissed after showing the appropriate screen CATransaction.begin()