Add supporting of different left and right menu width

This commit is contained in:
Alex Kozin
2017-07-20 18:16:01 +07:00
parent 6b9607fc9a
commit f9ec208e36
+14 -1
View File
@@ -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