From cdd96e304d94b85377679b76ba5a8264a7241c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjarke=20Hesthaven=20S=C3=B8ndergaard?= Date: Fri, 24 Feb 2017 12:56:20 +0100 Subject: [PATCH] Disabling opening the side menu Sometimes it would be nice to be able to disable opening the side menu even while there is a view controller. I'm not entirely sure about the naming of the property. My use case is that I have a subview of my navigation controller where I want to disable the side menu. I don't want to completely remove it just for this one view. --- Source/SideMenuController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/SideMenuController.swift b/Source/SideMenuController.swift index a4f1aa9..713539e 100644 --- a/Source/SideMenuController.swift +++ b/Source/SideMenuController.swift @@ -406,7 +406,10 @@ open class SideMenuController: UIViewController, UIGestureRecognizerDelegate { return screenSize.width < screenSize.height } + open var sidePanelDisabled = false + var canDisplaySideController: Bool { + guard !sidePanelDisabled else { return false } return sideViewController != nil }