From f9ec208e36a6c20cfc19f3c1d970750feb6f9546 Mon Sep 17 00:00:00 2001 From: Alex Kozin Date: Thu, 20 Jul 2017 18:16:01 +0700 Subject: [PATCH] Add supporting of different left and right menu width --- Pod/Classes/SideMenuManager.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Pod/Classes/SideMenuManager.swift b/Pod/Classes/SideMenuManager.swift index 7b2d0a6..32fd1b7 100644 --- a/Pod/Classes/SideMenuManager.swift +++ b/Pod/Classes/SideMenuManager.swift @@ -68,7 +68,20 @@ open class SideMenuManager : NSObject { open static var menuAllowPushOfSameClassTwice = true /// Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is 75% of the screen width. - open static var menuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240) + open static var leftMenuWidth: CGFloat = defaultMenuWidth + open static var rightMenuWidth: CGFloat = defaultMenuWidth + + open static let defaultMenuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240) + + open static var menuWidth: CGFloat { + get { + return SideMenuTransition.presentDirection == .left ? leftMenuWidth : rightMenuWidth + } + set { + leftMenuWidth = newValue + rightMenuWidth = newValue + } + } /// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds. open static var menuAnimationPresentDuration: Double = 0.35