2 // SideMenuManager.swift
4 // Created by Jon Kent on 12/6/15.
5 // Copyright © 2015 Jon Kent. All rights reserved.
10 SideMenuManager.menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? UISideMenuNavigationController
11 SideMenuManager.menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: "RightMenuNavigationController") as? UISideMenuNavigationController
13 // Enable gestures. The left and/or right menus must be set up above for these to work.
14 // Note that these continue to work on the Navigation Controller independent of the View Controller it displays!
15 SideMenuManager.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
16 SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
20 open class SideMenuManager : NSObject {
22 @objc public enum MenuPushStyle : Int {
27 preserveAndHideBackButton,
31 @objc public enum MenuPresentMode : Int {
38 // Bounds which has been allocated for the app on the whole device screen
39 internal static var appScreenRect: CGRect {
40 let appWindowRect = UIApplication.shared.keyWindow?.bounds ?? UIWindow().bounds
45 The push style of the menu.
47 There are six modes in MenuPushStyle:
48 - defaultBehavior: The view controller is pushed onto the stack.
49 - popWhenPossible: If a view controller already in the stack is of the same class as the pushed view controller, the stack is instead popped back to the existing view controller. This behavior can help users from getting lost in a deep navigation stack.
50 - preserve: If a view controller already in the stack is of the same class as the pushed view controller, the existing view controller is pushed to the end of the stack. This behavior is similar to a UITabBarController.
51 - preserveAndHideBackButton: Same as .preserve and back buttons are automatically hidden.
52 - replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved..
53 - subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu.
55 open var menuPushStyle: MenuPushStyle = .defaultBehavior
58 The presentation mode of the menu.
60 There are four modes in MenuPresentMode:
61 - menuSlideIn: Menu slides in over of the existing view.
62 - viewSlideOut: The existing view slides out to reveal the menu.
63 - viewSlideInOut: The existing view slides out while the menu slides in.
64 - menuDissolveIn: The menu dissolves in over the existing view controller.
66 open var menuPresentMode: MenuPresentMode = .viewSlideOut
68 /// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true.
69 open var menuAllowPushOfSameClassTwice = true
72 Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is 75% of the screen width or 240 points, whichever is smaller.
74 Note that each menu's width can be overridden using the `menuWidth` property on any `UISideMenuNavigationController` instance.
76 open var menuWidth: CGFloat = min(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
78 /// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds.
79 open var menuAnimationPresentDuration: Double = 0.35
81 /// Duration of the animation when the menu is dismissed without gestures. Default is 0.35 seconds.
82 open var menuAnimationDismissDuration: Double = 0.35
84 /// Duration of the remaining animation when the menu is partially dismissed with gestures. Default is 0.35 seconds.
85 open var menuAnimationCompleteGestureDuration: Double = 0.35
87 /// Amount to fade the existing view controller when the menu is presented. Default is 0 for no fade. Set to 1 to fade completely.
88 open var menuAnimationFadeStrength: CGFloat = 0
90 /// The amount to scale the existing view controller or the menu view controller depending on the `menuPresentMode`. Default is 1 for no scaling. Less than 1 will shrink, greater than 1 will grow.
91 open var menuAnimationTransformScaleFactor: CGFloat = 1
93 /// The background color behind menu animations. Depending on the animation settings this may not be visible. If `menuFadeStatusBar` is true, this color is used to fade it. Default is black.
94 open var menuAnimationBackgroundColor: UIColor?
96 /// The shadow opacity around the menu view controller or existing view controller depending on the `menuPresentMode`. Default is 0.5 for 50% opacity.
97 open var menuShadowOpacity: Float = 0.5
99 /// The shadow color around the menu view controller or existing view controller depending on the `menuPresentMode`. Default is black.
100 open var menuShadowColor = UIColor.black
102 /// The radius of the shadow around the menu view controller or existing view controller depending on the `menuPresentMode`. Default is 5.
103 open var menuShadowRadius: CGFloat = 5
105 /// Enable or disable interaction with the presenting view controller while the menu is displayed. Enabling may make it difficult to dismiss the menu or cause exceptions if the user tries to present and already presented menu. Default is false.
106 open var menuPresentingViewControllerUserInteractionEnabled: Bool = false
108 /// The strength of the parallax effect on the existing view controller. Does not apply to `menuPresentMode` when set to `ViewSlideOut`. Default is 0.
109 open var menuParallaxStrength: Int = 0
111 /// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true.
112 open var menuFadeStatusBar = true
114 /// The animation options when a menu is displayed. Ignored when displayed with a gesture.
115 open var menuAnimationOptions: UIViewAnimationOptions = .curveEaseInOut
117 /// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture.
118 open var menuAnimationUsingSpringWithDamping: CGFloat = 1
120 /// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
121 open var menuAnimationInitialSpringVelocity: CGFloat = 1
124 Automatically dismisses the menu when another view is pushed from it.
126 Note: to prevent the menu from dismissing when presenting, set modalPresentationStyle = .overFullScreen
127 of the view controller being presented in storyboard or during its initalization.
129 open var menuDismissOnPush = true
131 /// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation.
132 open var menuAlwaysAnimate = false
134 /// Default instance of SideMenuManager.
135 open static let `default` = SideMenuManager()
137 /// Default instance of SideMenuManager (objective-C).
138 open class var defaultManager: SideMenuManager {
140 return SideMenuManager.default
144 internal var transition: SideMenuTransition!
146 public override init() {
148 transition = SideMenuTransition(sideMenuManager: self)
152 The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController.
154 - Note: If you want cells in a UITableViewController menu to show vibrancy, make them a subclass of UITableViewVibrantCell.
156 open var menuBlurEffectStyle: UIBlurEffectStyle? {
158 if oldValue != menuBlurEffectStyle {
159 updateMenuBlurIfNecessary()
165 open var menuLeftNavigationController: UISideMenuNavigationController? {
167 guard menuLeftNavigationController != newValue, menuLeftNavigationController?.presentingViewController == nil else {
170 menuLeftNavigationController?.locked = false
171 removeMenuBlurForMenu(menuLeftNavigationController)
174 guard menuLeftNavigationController != oldValue else {
177 guard oldValue?.presentingViewController == nil else {
178 print("SideMenu Warning: menuLeftNavigationController cannot be modified while it's presented.")
179 menuLeftNavigationController = oldValue
183 setupNavigationController(menuLeftNavigationController, leftSide: true)
188 open var menuRightNavigationController: UISideMenuNavigationController? {
190 guard menuRightNavigationController != newValue, menuRightNavigationController?.presentingViewController == nil else {
193 removeMenuBlurForMenu(menuRightNavigationController)
196 guard menuRightNavigationController != oldValue else {
199 guard oldValue?.presentingViewController == nil else {
200 print("SideMenu Warning: menuRightNavigationController cannot be modified while it's presented.")
201 menuRightNavigationController = oldValue
204 setupNavigationController(menuRightNavigationController, leftSide: false)
208 /// The left menu swipe to dismiss gesture.
209 open weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
211 oldValue?.view?.removeGestureRecognizer(oldValue!)
212 setupGesture(gesture: menuLeftSwipeToDismissGesture)
216 /// The right menu swipe to dismiss gesture.
217 open weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
219 oldValue?.view?.removeGestureRecognizer(oldValue!)
220 setupGesture(gesture: menuRightSwipeToDismissGesture)
224 fileprivate func setupGesture(gesture: UIPanGestureRecognizer?) {
225 guard let gesture = gesture else {
229 gesture.addTarget(transition, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
232 fileprivate func setupNavigationController(_ forMenu: UISideMenuNavigationController?, leftSide: Bool) {
233 guard let forMenu = forMenu else {
237 forMenu.transitioningDelegate = transition
238 forMenu.modalPresentationStyle = .overFullScreen
239 forMenu.leftSide = leftSide
241 if forMenu.sideMenuManager != self {
243 if forMenu.sideMenuManager?.menuLeftNavigationController == forMenu {
244 print("SideMenu Warning: \(String(describing: forMenu.self)) was already assigned to the menuLeftNavigationController of \(String(describing: forMenu.sideMenuManager!.self)). When using multiple SideMenuManagers you may want to use new instances of UISideMenuNavigationController instead of existing instances to avoid crashes if the menu is presented more than once.")
245 } else if forMenu.sideMenuManager?.menuRightNavigationController == forMenu {
246 print("SideMenu Warning: \(String(describing: forMenu.self)) was already assigned to the menuRightNavigationController of \(String(describing: forMenu.sideMenuManager!.self)). When using multiple SideMenuManagers you may want to use new instances of UISideMenuNavigationController instead of existing instances to avoid crashes if the menu is presented more than once.")
249 forMenu.sideMenuManager = self
252 forMenu.locked = true
254 if menuEnableSwipeGestures {
255 let exitPanGesture = UIPanGestureRecognizer()
256 forMenu.view.addGestureRecognizer(exitPanGesture)
258 menuLeftSwipeToDismissGesture = exitPanGesture
260 menuRightSwipeToDismissGesture = exitPanGesture
264 // Ensures minimal lag when revealing the menu for the first time using gestures by loading the view:
265 let _ = forMenu.topViewController?.view
267 updateMenuBlurIfNecessary()
270 /// Enable or disable gestures that would swipe to dismiss the menu. Default is true.
271 open var menuEnableSwipeGestures: Bool = true {
273 menuLeftSwipeToDismissGesture?.view?.removeGestureRecognizer(menuLeftSwipeToDismissGesture!)
274 menuRightSwipeToDismissGesture?.view?.removeGestureRecognizer(menuRightSwipeToDismissGesture!)
275 setupNavigationController(menuLeftNavigationController, leftSide: true)
276 setupNavigationController(menuRightNavigationController, leftSide: false)
280 fileprivate func updateMenuBlurIfNecessary() {
281 if let menuLeftNavigationController = self.menuLeftNavigationController {
282 setupMenuBlurForMenu(menuLeftNavigationController)
284 if let menuRightNavigationController = self.menuRightNavigationController {
285 setupMenuBlurForMenu(menuRightNavigationController)
289 fileprivate func setupMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
290 removeMenuBlurForMenu(forMenu)
292 guard let forMenu = forMenu,
293 let menuBlurEffectStyle = menuBlurEffectStyle,
294 let view = forMenu.topViewController?.view,
295 !UIAccessibilityIsReduceTransparencyEnabled() else {
299 if forMenu.originalMenuBackgroundColor == nil {
300 forMenu.originalMenuBackgroundColor = view.backgroundColor
303 let blurEffect = UIBlurEffect(style: menuBlurEffectStyle)
304 let blurView = UIVisualEffectView(effect: blurEffect)
305 view.backgroundColor = UIColor.clear
306 if let tableViewController = forMenu.topViewController as? UITableViewController {
307 tableViewController.tableView.backgroundView = blurView
308 tableViewController.tableView.separatorEffect = UIVibrancyEffect(blurEffect: blurEffect)
309 tableViewController.tableView.reloadData()
311 blurView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
312 blurView.frame = view.bounds
313 view.insertSubview(blurView, at: 0)
317 fileprivate func removeMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
318 guard let forMenu = forMenu,
319 let originalMenuBackgroundColor = forMenu.originalMenuBackgroundColor,
320 let view = forMenu.topViewController?.view else {
324 view.backgroundColor = originalMenuBackgroundColor
325 forMenu.originalMenuBackgroundColor = nil
327 if let tableViewController = forMenu.topViewController as? UITableViewController {
328 tableViewController.tableView.backgroundView = nil
329 tableViewController.tableView.separatorEffect = nil
330 tableViewController.tableView.reloadData()
331 } else if let blurView = view.subviews[0] as? UIVisualEffectView {
332 blurView.removeFromSuperview()
337 Adds screen edge gestures to a view to present a menu.
339 - Parameter toView: The view to add gestures to.
340 - Parameter forMenu: The menu (left or right) you want to add a gesture for. If unspecified, gestures will be added for both sides.
342 - Returns: The array of screen edge gestures added to `toView`.
344 @discardableResult open func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer] {
345 var array = [UIScreenEdgePanGestureRecognizer]()
347 let newScreenEdgeGesture = { () -> UIScreenEdgePanGestureRecognizer in
348 let screenEdgeGestureRecognizer = UIScreenEdgePanGestureRecognizer()
349 screenEdgeGestureRecognizer.cancelsTouchesInView = true
350 toView.addGestureRecognizer(screenEdgeGestureRecognizer)
351 array.append(screenEdgeGestureRecognizer)
352 return screenEdgeGestureRecognizer
355 if forMenu != .right {
356 let leftScreenEdgeGestureRecognizer = newScreenEdgeGesture()
357 leftScreenEdgeGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuLeftScreenEdge(_:)))
358 leftScreenEdgeGestureRecognizer.edges = .left
361 if menuLeftNavigationController == nil {
362 print("SideMenu Warning: menuAddScreenEdgePanGesturesToPresent was called before menuLeftNavigationController was set. The gesture will not work without a menu. Use menuAddScreenEdgePanGesturesToPresent(toView:forMenu:) to add gestures for only one menu.")
367 if forMenu != .left {
368 let rightScreenEdgeGestureRecognizer = newScreenEdgeGesture()
369 rightScreenEdgeGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuRightScreenEdge(_:)))
370 rightScreenEdgeGestureRecognizer.edges = .right
373 if menuRightNavigationController == nil {
374 print("SideMenu Warning: menuAddScreenEdgePanGesturesToPresent was called before menuRightNavigationController was set. The gesture will not work without a menu. Use menuAddScreenEdgePanGesturesToPresent(toView:forMenu:) to add gestures for only one menu.")
383 Adds a pan edge gesture to a view to present menus.
385 - Parameter toView: The view to add a pan gesture to.
387 - Returns: The pan gesture added to `toView`.
389 @discardableResult open func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer {
390 let panGestureRecognizer = UIPanGestureRecognizer()
391 panGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuPan(_:)))
392 toView.addGestureRecognizer(panGestureRecognizer)
394 if menuLeftNavigationController ?? menuRightNavigationController == nil {
395 print("SideMenu Warning: menuAddPanGestureToPresent called before menuLeftNavigationController or menuRightNavigationController have been defined. Gestures will not work without a menu.")
398 return panGestureRecognizer
402 // Deprecations, to be removed at a future date.
403 extension SideMenuManager {
405 @available(*, deprecated, renamed: "default.menuPushStyle", message: "SideMenuManager class methods deprecated.")
406 open static var menuPushStyle: MenuPushStyle {
408 return `default`.menuPushStyle
411 `default`.menuPushStyle = newValue
414 @available(*, deprecated, renamed: "default.menuPresentMode", message: "SideMenuManager class methods deprecated.")
415 open static var menuPresentMode: MenuPresentMode {
417 return `default`.menuPresentMode
420 `default`.menuPresentMode = newValue
423 @available(*, deprecated, renamed: "default.menuAllowPushOfSameClassTwice", message: "SideMenuManager class methods deprecated.")
424 open static var menuAllowPushOfSameClassTwice: Bool {
426 return `default`.menuAllowPushOfSameClassTwice
429 `default`.menuAllowPushOfSameClassTwice = newValue
432 @available(*, deprecated, renamed: "default.menuWidth", message: "SideMenuManager class methods deprecated.")
433 open static var menuWidth: CGFloat {
435 return `default`.menuWidth
438 `default`.menuWidth = newValue
441 @available(*, deprecated, renamed: "default.menuAnimationPresentDuration", message: "SideMenuManager class methods deprecated.")
442 open static var menuAnimationPresentDuration: Double {
444 return `default`.menuAnimationPresentDuration
447 `default`.menuAnimationPresentDuration = newValue
450 @available(*, deprecated, renamed: "default.menuAnimationDismissDuration", message: "SideMenuManager class methods deprecated.")
451 open static var menuAnimationDismissDuration: Double {
453 return `default`.menuAnimationDismissDuration
456 `default`.menuAnimationDismissDuration = newValue
459 @available(*, deprecated, renamed: "default.menuAnimationCompleteGestureDuration", message: "SideMenuManager class methods deprecated.")
460 open static var menuAnimationCompleteGestureDuration: Double {
462 return `default`.menuAnimationCompleteGestureDuration
465 `default`.menuAnimationCompleteGestureDuration = newValue
468 @available(*, deprecated, renamed: "default.menuAnimationFadeStrength", message: "SideMenuManager class methods deprecated.")
469 open static var menuAnimationFadeStrength: CGFloat {
471 return `default`.menuAnimationFadeStrength
474 `default`.menuAnimationFadeStrength = newValue
477 @available(*, deprecated, renamed: "default.menuAnimationTransformScaleFactor", message: "SideMenuManager class methods deprecated.")
478 open static var menuAnimationTransformScaleFactor: CGFloat {
480 return `default`.menuAnimationTransformScaleFactor
483 `default`.menuAnimationTransformScaleFactor = newValue
486 @available(*, deprecated, renamed: "default.menuAnimationBackgroundColor", message: "SideMenuManager class methods deprecated.")
487 open static var menuAnimationBackgroundColor: UIColor? {
489 return `default`.menuAnimationBackgroundColor
492 `default`.menuAnimationBackgroundColor = newValue
495 @available(*, deprecated, renamed: "default.menuShadowOpacity", message: "SideMenuManager class methods deprecated.")
496 open static var menuShadowOpacity: Float {
498 return `default`.menuShadowOpacity
501 `default`.menuShadowOpacity = newValue
504 @available(*, deprecated, renamed: "default.menuShadowColor", message: "SideMenuManager class methods deprecated.")
505 open static var menuShadowColor: UIColor {
507 return `default`.menuShadowColor
510 `default`.menuShadowColor = newValue
513 @available(*, deprecated, renamed: "default.menuShadowRadius", message: "SideMenuManager class methods deprecated.")
514 open static var menuShadowRadius: CGFloat {
516 return `default`.menuShadowRadius
519 `default`.menuShadowRadius = newValue
522 @available(*, deprecated, renamed: "default.menuPresentingViewControllerUserInteractionEnabled", message: "SideMenuManager class methods deprecated.")
523 open static var menuPresentingViewControllerUserInteractionEnabled: Bool {
525 return `default`.menuPresentingViewControllerUserInteractionEnabled
528 `default`.menuPresentingViewControllerUserInteractionEnabled = newValue
531 @available(*, deprecated, renamed: "default.menuParallaxStrength", message: "SideMenuManager class methods deprecated.")
532 open static var menuParallaxStrength: Int {
534 return `default`.menuParallaxStrength
537 `default`.menuParallaxStrength = newValue
540 @available(*, deprecated, renamed: "default.menuFadeStatusBar", message: "SideMenuManager class methods deprecated.")
541 open static var menuFadeStatusBar: Bool {
543 return `default`.menuFadeStatusBar
546 `default`.menuFadeStatusBar = newValue
549 @available(*, deprecated, renamed: "default.menuAnimationOptions", message: "SideMenuManager class methods deprecated.")
550 open static var menuAnimationOptions: UIViewAnimationOptions {
552 return `default`.menuAnimationOptions
555 `default`.menuAnimationOptions = newValue
558 @available(*, deprecated, renamed: "default.menuAnimationUsingSpringWithDamping", message: "SideMenuManager class methods deprecated.")
559 open static var menuAnimationUsingSpringWithDamping: CGFloat {
561 return `default`.menuAnimationUsingSpringWithDamping
564 `default`.menuAnimationUsingSpringWithDamping = newValue
567 @available(*, deprecated, renamed: "default.menuAnimationInitialSpringVelocity", message: "SideMenuManager class methods deprecated.")
568 open static var menuAnimationInitialSpringVelocity: CGFloat {
570 return `default`.menuAnimationInitialSpringVelocity
573 `default`.menuAnimationInitialSpringVelocity = newValue
576 @available(*, deprecated, renamed: "default.menuDismissOnPush", message: "SideMenuManager class methods deprecated.")
577 open static var menuDismissOnPush: Bool {
579 return `default`.menuDismissOnPush
582 `default`.menuDismissOnPush = newValue
585 /// -Warning: Deprecated. Use `menuPushStyle = .subMenu` instead.
586 @available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .subMenu` instead.")
587 open static var menuAllowSubmenus: Bool {
589 return menuPushStyle == .subMenu
593 menuPushStyle = .subMenu
597 /// -Warning: Deprecated. Use `menuPushStyle = .popWhenPossible` instead.
598 @available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .popWhenPossible` instead.")
599 open static var menuAllowPopIfPossible: Bool {
601 return menuPushStyle == .popWhenPossible
605 menuPushStyle = .popWhenPossible
609 /// -Warning: Deprecated. Use `menuPushStyle = .replace` instead.
610 @available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .replace` instead.")
611 open static var menuReplaceOnPush: Bool {
613 return menuPushStyle == .replace
617 menuPushStyle = .replace
621 @available(*, deprecated, renamed: "default.menuBlurEffectStyle", message: "SideMenuManager class methods deprecated.")
622 open static var menuBlurEffectStyle: UIBlurEffectStyle? {
624 return `default`.menuBlurEffectStyle
627 `default`.menuBlurEffectStyle = newValue
630 @available(*, deprecated, renamed: "default.menuLeftNavigationController", message: "SideMenuManager class methods deprecated.")
631 open static var menuLeftNavigationController: UISideMenuNavigationController? {
633 return `default`.menuLeftNavigationController
636 `default`.menuLeftNavigationController = newValue
639 @available(*, deprecated, renamed: "default.menuRightNavigationController", message: "SideMenuManager class methods deprecated.")
640 open static var menuRightNavigationController: UISideMenuNavigationController? {
642 return `default`.menuRightNavigationController
645 `default`.menuRightNavigationController = newValue
648 @available(*, deprecated, renamed: "default.menuLeftSwipeToDismissGesture", message: "SideMenuManager class methods deprecated.")
649 open static weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
651 return `default`.menuLeftSwipeToDismissGesture
654 `default`.menuLeftSwipeToDismissGesture = newValue
657 @available(*, deprecated, renamed: "default.menuRightSwipeToDismissGesture", message: "SideMenuManager class methods deprecated.")
658 open static weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
660 return `default`.menuRightSwipeToDismissGesture
663 `default`.menuRightSwipeToDismissGesture = newValue
666 @available(*, deprecated, renamed: "default.menuEnableSwipeGestures", message: "SideMenuManager class methods deprecated.")
667 open static var menuEnableSwipeGestures: Bool {
669 return `default`.menuEnableSwipeGestures
672 `default`.menuEnableSwipeGestures = newValue
675 @available(*, deprecated, renamed: "default.menuAddScreenEdgePanGesturesToPresent", message: "SideMenuManager class methods deprecated.")
676 @discardableResult open class func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer] {
677 return `default`.menuAddScreenEdgePanGesturesToPresent(toView: toView, forMenu: forMenu)
679 @available(*, deprecated, renamed: "default.menuAddPanGestureToPresent", message: "SideMenuManager class methods deprecated.")
680 @discardableResult open class func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer {
681 return `default`.menuAddPanGestureToPresent(toView: toView)