Support for forcing animated menu dismissal even when pushed view controllers are not animated.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user