Compare commits

..

6 Commits

Author SHA1 Message Date
jonkykong a2f299bb5f Updated podspec. 2017-10-11 14:43:08 -07:00
jonkykong 031f97d770 Update README for Cocoapods. 2017-10-11 14:40:45 -07:00
jonkykong 977f9a5b70 README correction. 2017-10-11 14:39:34 -07:00
jonkykong 3a14516905 Better logic for managing UISideMenuNavigationController properties across interface builder and programmatic instantiations. 2017-10-11 14:39:22 -07:00
jonkykong ddefba9c87 Revert README for Github. 2017-10-10 18:37:00 -07:00
jonkykong d3f59a45a7 Merge tag '3.1'
* tag '3.1':
  Updated README for Cocoapods.
  Updated podspec.
  Update README.md
  Updated README.
  Fix for non-animated dismissal of menu causing a black screen.
  Renamed class and refactored how blurring works in UITableViewVibrantCell.
  Major project update to support multiple SideMenuManager instances beyond the primary instance, if necessary.
  Added isHidden property.
  Support for delegate methods on SideMenu appearing/disappearing.
  Refactor.
  Refactoring.
  Fix for menuDismissOnPush as it was incorrectly applied.
  Fix for regression on enums to objective-C.
2017-10-10 18:36:29 -07:00
4 changed files with 21 additions and 8 deletions
+3
View File
@@ -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
}
}
}
-1
View File
@@ -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
View File
@@ -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.