Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a2f299bb5f | |||
| 031f97d770 | |||
| 977f9a5b70 | |||
| 3a14516905 | |||
| ddefba9c87 | |||
| d3f59a45a7 |
@@ -155,6 +155,7 @@ open class SideMenuManager : NSObject {
|
||||
guard menuLeftNavigationController != newValue, menuLeftNavigationController?.presentingViewController == nil else {
|
||||
return
|
||||
}
|
||||
menuLeftNavigationController?.locked = false
|
||||
removeMenuBlurForMenu(menuLeftNavigationController)
|
||||
}
|
||||
didSet {
|
||||
@@ -234,6 +235,8 @@ open class SideMenuManager : NSObject {
|
||||
forMenu.sideMenuManager = self
|
||||
}
|
||||
|
||||
forMenu.locked = true
|
||||
|
||||
if menuEnableSwipeGestures {
|
||||
let exitPanGesture = UIPanGestureRecognizer()
|
||||
forMenu.view.addGestureRecognizer(exitPanGesture)
|
||||
|
||||
@@ -39,6 +39,8 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
temporarySideMenuDelegate = forViewController as? UISideMenuNavigationControllerDelegate
|
||||
return temporarySideMenuDelegate
|
||||
}
|
||||
fileprivate var usingInterfaceBuilder = false
|
||||
internal var locked = false
|
||||
internal var originalMenuBackgroundColor: UIColor?
|
||||
internal var transition: SideMenuTransition {
|
||||
get {
|
||||
@@ -58,7 +60,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
/// SideMenuManager instance associated with this menu. Default is `SideMenuManager.default`. This property cannot be changed after the menu has loaded.
|
||||
open weak var sideMenuManager: SideMenuManager! = SideMenuManager.default {
|
||||
didSet {
|
||||
if isViewLoaded && oldValue != nil {
|
||||
if locked && oldValue != nil {
|
||||
print("SideMenu Warning: a menu's sideMenuManager property cannot be changed after it has loaded.")
|
||||
sideMenuManager = oldValue
|
||||
}
|
||||
@@ -69,6 +71,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
@IBInspectable open var menuWidth: CGFloat = 0 {
|
||||
didSet {
|
||||
if !isHidden && oldValue != menuWidth {
|
||||
print("SideMenu Warning: a menu's width property can only be changed when it is hidden.")
|
||||
menuWidth = oldValue
|
||||
}
|
||||
}
|
||||
@@ -77,7 +80,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
/// Whether the menu appears on the right or left side of the screen. Right is the default. This property cannot be changed after the menu has loaded.
|
||||
@IBInspectable open var leftSide: Bool = false {
|
||||
didSet {
|
||||
if isViewLoaded && leftSide != oldValue {
|
||||
if locked && leftSide != oldValue {
|
||||
print("SideMenu Warning: a menu's leftSide property cannot be changed after it has loaded.")
|
||||
leftSide = oldValue
|
||||
}
|
||||
@@ -91,13 +94,21 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
open override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
usingInterfaceBuilder = true
|
||||
}
|
||||
|
||||
override open func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
if leftSide {
|
||||
sideMenuManager.menuLeftNavigationController = self
|
||||
} else {
|
||||
sideMenuManager.menuRightNavigationController = self
|
||||
if !locked && usingInterfaceBuilder {
|
||||
if leftSide {
|
||||
sideMenuManager.menuLeftNavigationController = self
|
||||
} else {
|
||||
sideMenuManager.menuRightNavigationController = self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ In your view controller's `viewDidLoad` event, do something like this (**IMPORTA
|
||||
``` swift
|
||||
// Define the menus
|
||||
let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
menuLeftNavigationController.leftSide = true
|
||||
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration
|
||||
// of it here like setting its viewControllers. If you're using storyboards, you'll want to do something like:
|
||||
// let menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as! UISideMenuNavigationController
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "3.1"
|
||||
s.version = "3.1.1"
|
||||
s.summary = "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required."
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
Reference in New Issue
Block a user