Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc37f1b9cb | |||
| 8aff2b3627 | |||
| 135a3d2a94 | |||
| a10b94e351 | |||
| e1bf7c4991 | |||
| b19c93ff2c | |||
| 3968686410 | |||
| 0a457b414e | |||
| 5abf5ca740 | |||
| 498669bf58 | |||
| 159c87871b | |||
| 4c0733d82a | |||
| c3671408da | |||
| 3268b15e54 |
@@ -291,7 +291,7 @@
|
||||
<!--Side Menu Navigation Controller-->
|
||||
<scene sceneID="Zbc-0f-8nT">
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="LeftMenuNavigationController" navigationBarHidden="YES" id="DuX-EW-0mP" customClass="UISideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
|
||||
<navigationController storyboardIdentifier="LeftMenuNavigationController" navigationBarHidden="YES" id="DuX-EW-0mP" customClass="SideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
|
||||
<navigationItem key="navigationItem" id="ipz-Lx-Wgf"/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="35F-wh-r6h">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@@ -423,7 +423,7 @@
|
||||
<!--Side Menu Navigation Controller-->
|
||||
<scene sceneID="kei-0w-mFw">
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="RightMenuNavigationController" navigationBarHidden="YES" id="z7k-fk-pfc" customClass="UISideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
|
||||
<navigationController storyboardIdentifier="RightMenuNavigationController" navigationBarHidden="YES" id="z7k-fk-pfc" customClass="SideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="qOd-yQ-2i8">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
|
||||
@@ -26,14 +26,14 @@ class MainViewController: UIViewController {
|
||||
}
|
||||
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
guard let sideMenuNavigationController = segue.destination as? UISideMenuNavigationController else { return }
|
||||
guard let sideMenuNavigationController = segue.destination as? SideMenuNavigationController else { return }
|
||||
sideMenuNavigationController.settings = makeSettings()
|
||||
}
|
||||
|
||||
private func setupSideMenu() {
|
||||
// Define the menus
|
||||
SideMenuManager.default.leftMenuNavigationController = storyboard?.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? UISideMenuNavigationController
|
||||
SideMenuManager.default.rightMenuNavigationController = storyboard?.instantiateViewController(withIdentifier: "RightMenuNavigationController") as? UISideMenuNavigationController
|
||||
SideMenuManager.default.leftMenuNavigationController = storyboard?.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? SideMenuNavigationController
|
||||
SideMenuManager.default.rightMenuNavigationController = storyboard?.instantiateViewController(withIdentifier: "RightMenuNavigationController") as? SideMenuNavigationController
|
||||
|
||||
// Enable gestures. The left and/or right menus must be set up above for these to work.
|
||||
// Note that these continue to work on the Navigation Controller independent of the View Controller it displays!
|
||||
@@ -98,21 +98,21 @@ class MainViewController: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
extension MainViewController: UISideMenuNavigationControllerDelegate {
|
||||
extension MainViewController: SideMenuNavigationControllerDelegate {
|
||||
|
||||
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuWillAppear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuDidAppear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appeared! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuWillDisappear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuDidDisappear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappeared! (animated: \(animated))")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class SideMenuTableViewController: UITableViewController {
|
||||
// refresh cell blur effect in case it changed
|
||||
tableView.reloadData()
|
||||
|
||||
guard let menu = navigationController as? UISideMenuNavigationController, menu.blurEffectStyle == nil else {
|
||||
guard let menu = navigationController as? SideMenuNavigationController, menu.blurEffectStyle == nil else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class SideMenuTableViewController: UITableViewController {
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = super.tableView(tableView, cellForRowAt: indexPath) as! UITableViewVibrantCell
|
||||
|
||||
if let menu = navigationController as? UISideMenuNavigationController {
|
||||
if let menu = navigationController as? SideMenuNavigationController {
|
||||
cell.blurEffectStyle = menu.blurEffectStyle
|
||||
}
|
||||
|
||||
|
||||
@@ -9,54 +9,54 @@
|
||||
extension SideMenuManager {
|
||||
|
||||
@available(*, deprecated, renamed: "leftMenuNavigationController")
|
||||
open var menuLeftNavigationController: UISideMenuNavigationController? {
|
||||
open var menuLeftNavigationController: SideMenuNavigationController? {
|
||||
get { return nil }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "rightMenuNavigationController")
|
||||
open var menuRightNavigationController: UISideMenuNavigationController? {
|
||||
open var menuRightNavigationController: SideMenuNavigationController? {
|
||||
get { return nil }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuPresentMode: SideMenuPresentationStyle {
|
||||
get { return .viewSlideOut }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuPushStyle: SideMenuPushStyle {
|
||||
get { return .default }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAllowPushOfSameClassTwice: Bool {
|
||||
get { return true }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuWidth: CGFloat {
|
||||
get { return 0 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationPresentDuration: Double {
|
||||
get { return 0.35 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationDismissDuration: Double {
|
||||
get { return 0.35 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationCompleteGestureDuration: Double {
|
||||
get { return 0.35 }
|
||||
set {}
|
||||
@@ -98,7 +98,7 @@ extension SideMenuManager {
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuPresentingViewControllerUserInteractionEnabled: Bool {
|
||||
get { return false }
|
||||
set {}
|
||||
@@ -110,73 +110,73 @@ extension SideMenuManager {
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuFadeStatusBar: Bool {
|
||||
get { return true }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationOptions: UIView.AnimationOptions {
|
||||
get { return .curveEaseInOut }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationCompletionCurve: UIView.AnimationCurve {
|
||||
get { return .easeIn }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationUsingSpringWithDamping: CGFloat {
|
||||
get { return 1 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAnimationInitialSpringVelocity: CGFloat {
|
||||
get { return 1 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuDismissOnPush: Bool {
|
||||
get { return true }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuAlwaysAnimate: Bool {
|
||||
get { return false }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuDismissWhenBackgrounded: Bool {
|
||||
get { return true }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuBlurEffectStyle: UIBlurEffect.Style? {
|
||||
get { return nil }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
|
||||
get { return nil }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
|
||||
get { return nil }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuNavigationController class.")
|
||||
public var menuEnableSwipeGestures: Bool {
|
||||
get { return true }
|
||||
set {}
|
||||
@@ -206,3 +206,9 @@ extension SideMenuPresentationStyle {
|
||||
@available(*, deprecated, renamed: "viewSlideOutMenuIn")
|
||||
public static var viewSlideInOut: SideMenuPresentationStyle { return viewSlideOutMenuIn }
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "SideMenuNavigationController")
|
||||
public typealias UISideMenuNavigationController = SideMenuNavigationController
|
||||
|
||||
@available(*, deprecated, renamed: "SideMenuNavigationControllerDelegate")
|
||||
public typealias UISideMenuNavigationControllerDelegate = SideMenuNavigationControllerDelegate
|
||||
|
||||
@@ -7,12 +7,11 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public protocol InitializableClass: class {
|
||||
internal protocol InitializableClass: class {
|
||||
init()
|
||||
}
|
||||
|
||||
public extension InitializableClass {
|
||||
|
||||
extension InitializableClass {
|
||||
init(_ block: (Self) -> Void) {
|
||||
self.init()
|
||||
block(self)
|
||||
|
||||
@@ -9,8 +9,8 @@ import Foundation
|
||||
|
||||
internal enum Print: String { case
|
||||
cannotPush = "Attempt to push a View Controller from %@ where its navigationController == nil. It must be embedded in a UINavigationController for this to work.",
|
||||
emptyMenu = "The menu doesn't have a view controller to show! UISideMenuNavigationController needs a view controller to display just like a UINavigationController.",
|
||||
menuAlreadyAssigned = "%@ was already assigned to the %@ of %@. When using multiple SideMenuManagers you may want to use new instances of UISideMenuNavigationController instead of existing instances to avoid crashes if the menu is presented more than once.",
|
||||
emptyMenu = "The menu doesn't have a view controller to show! SideMenuNavigationController needs a view controller to display just like a UINavigationController.",
|
||||
menuAlreadyAssigned = "%@ was already assigned to the %@ of %@. When using multiple SideMenuManagers you may want to use new instances of SideMenuNavigationController instead of existing instances to avoid crashes if the menu is presented more than once.",
|
||||
menuInUse = "%@ cannot be modified while it's presented.",
|
||||
panGestureAdded = "%@ was called before %@ or %@ was set. Gestures will not work without a menu.",
|
||||
property = "A menu's %@ property can only be changed when it is hidden.",
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SideMenuManager: NSObject {
|
||||
}
|
||||
|
||||
/// The left menu.
|
||||
open var leftMenuNavigationController: UISideMenuNavigationController? {
|
||||
open var leftMenuNavigationController: SideMenuNavigationController? {
|
||||
get {
|
||||
if _leftMenu.value?.isHidden == true {
|
||||
_leftMenu.value?.leftSide = true
|
||||
@@ -61,7 +61,7 @@ public class SideMenuManager: NSObject {
|
||||
}
|
||||
|
||||
/// The right menu.
|
||||
open var rightMenuNavigationController: UISideMenuNavigationController? {
|
||||
open var rightMenuNavigationController: SideMenuNavigationController? {
|
||||
get {
|
||||
if _rightMenu.value?.isHidden == true {
|
||||
_rightMenu.value?.leftSide = false
|
||||
@@ -221,7 +221,7 @@ private extension SideMenuManager {
|
||||
}
|
||||
}
|
||||
|
||||
extension SideMenuManager: UISideMenuNavigationControllerTransitionDelegate {
|
||||
extension SideMenuManager: SideMenuNavigationControllerTransitionDelegate {
|
||||
|
||||
internal func sideMenuTransitionDidDismiss(menu: Menu) {
|
||||
defer { switching = false }
|
||||
|
||||
+18
-18
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// UISideMenuNavigationController.swift
|
||||
// SideMenuNavigationController.swift
|
||||
//
|
||||
// Created by Jon Kent on 1/14/16.
|
||||
// Copyright © 2016 Jon Kent. All rights reserved.
|
||||
@@ -16,14 +16,14 @@ import UIKit
|
||||
subMenu
|
||||
}
|
||||
|
||||
@objc public protocol UISideMenuNavigationControllerDelegate {
|
||||
@objc optional func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool)
|
||||
@objc optional func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool)
|
||||
@objc optional func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool)
|
||||
@objc optional func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool)
|
||||
@objc public protocol SideMenuNavigationControllerDelegate {
|
||||
@objc optional func sideMenuWillAppear(menu: SideMenuNavigationController, animated: Bool)
|
||||
@objc optional func sideMenuDidAppear(menu: SideMenuNavigationController, animated: Bool)
|
||||
@objc optional func sideMenuWillDisappear(menu: SideMenuNavigationController, animated: Bool)
|
||||
@objc optional func sideMenuDidDisappear(menu: SideMenuNavigationController, animated: Bool)
|
||||
}
|
||||
|
||||
internal protocol UISideMenuNavigationControllerTransitionDelegate: class {
|
||||
internal protocol SideMenuNavigationControllerTransitionDelegate: class {
|
||||
func sideMenuTransitionDidDismiss(menu: Menu)
|
||||
}
|
||||
|
||||
@@ -58,10 +58,10 @@ public struct SideMenuSettings: MenuModel, InitializableStruct {
|
||||
public init() {}
|
||||
}
|
||||
|
||||
internal typealias Menu = UISideMenuNavigationController
|
||||
internal typealias Menu = SideMenuNavigationController
|
||||
|
||||
@objcMembers
|
||||
open class UISideMenuNavigationController: UINavigationController {
|
||||
open class SideMenuNavigationController: UINavigationController {
|
||||
|
||||
private lazy var _leftSide = Protected(false) { [weak self] oldValue, newValue in
|
||||
guard self?.isHidden != false else {
|
||||
@@ -79,8 +79,8 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
private var rotating: Bool = false
|
||||
private var transitionController: SideMenuTransitionController?
|
||||
|
||||
/// Delegate for receiving appear and disappear related events. If `nil` the visible view controller that displays a `UISideMenuNavigationController` automatically receives these events.
|
||||
internal weak var sideMenuDelegate: UISideMenuNavigationControllerDelegate?
|
||||
/// Delegate for receiving appear and disappear related events. If `nil` the visible view controller that displays a `SideMenuNavigationController` automatically receives these events.
|
||||
public weak var sideMenuDelegate: SideMenuNavigationControllerDelegate?
|
||||
|
||||
/// The swipe to dismiss gesture.
|
||||
open private(set) weak var swipeToDismissGesture: UIPanGestureRecognizer? = nil
|
||||
@@ -328,7 +328,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
}
|
||||
|
||||
// Interface
|
||||
extension UISideMenuNavigationController: MenuModel {
|
||||
extension SideMenuNavigationController: MenuModel {
|
||||
|
||||
@IBInspectable open var allowPushOfSameClassTwice: Bool {
|
||||
get { return settings.allowPushOfSameClassTwice }
|
||||
@@ -453,7 +453,7 @@ extension UISideMenuNavigationController: MenuModel {
|
||||
}
|
||||
|
||||
// IMPORTANT: These methods must be declared open or they will not be called.
|
||||
extension UISideMenuNavigationController: UIViewControllerTransitioningDelegate {
|
||||
extension SideMenuNavigationController: UIViewControllerTransitioningDelegate {
|
||||
|
||||
open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
|
||||
transitionController = SideMenuTransitionController(
|
||||
@@ -484,7 +484,7 @@ extension UISideMenuNavigationController: UIViewControllerTransitioningDelegate
|
||||
}
|
||||
}
|
||||
|
||||
extension UISideMenuNavigationController: SideMenuTransitionControllerDelegate {
|
||||
extension SideMenuNavigationController: SideMenuTransitionControllerDelegate {
|
||||
|
||||
internal func sideMenuTransitionController(_ transitionController: SideMenuTransitionController, didDismiss viewController: UIViewController) {
|
||||
sideMenuManager.sideMenuTransitionDidDismiss(menu: self)
|
||||
@@ -497,7 +497,7 @@ extension UISideMenuNavigationController: SideMenuTransitionControllerDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
internal extension UISideMenuNavigationController {
|
||||
internal extension SideMenuNavigationController {
|
||||
|
||||
func handleMenuPan(_ gesture: UIPanGestureRecognizer, _ presenting: Bool) {
|
||||
let width = menuWidth
|
||||
@@ -538,14 +538,14 @@ internal extension UISideMenuNavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
private extension UISideMenuNavigationController {
|
||||
private extension SideMenuNavigationController {
|
||||
|
||||
weak var activeDelegate: UISideMenuNavigationControllerDelegate? {
|
||||
weak var activeDelegate: SideMenuNavigationControllerDelegate? {
|
||||
guard !view.isHidden else { return nil }
|
||||
if let sideMenuDelegate = sideMenuDelegate {
|
||||
return sideMenuDelegate
|
||||
}
|
||||
return visibleViewController(from: presentingViewController) as? UISideMenuNavigationControllerDelegate
|
||||
return visibleViewController(from: presentingViewController) as? SideMenuNavigationControllerDelegate
|
||||
}
|
||||
|
||||
func visibleViewController(from: UIViewController?) -> UIViewController? {
|
||||
@@ -221,7 +221,7 @@ private extension SideMenuPresentationController {
|
||||
view.layer.shadowColor = config.presentationStyle.onTopShadowColor.cgColor
|
||||
view.layer.shadowRadius = config.presentationStyle.onTopShadowRadius
|
||||
view.layer.shadowOpacity = config.presentationStyle.onTopShadowOpacity
|
||||
view.layer.shadowOffset = CGSize(width: 0, height: 0)
|
||||
view.layer.shadowOffset = config.presentationStyle.onTopShadowOffset
|
||||
}
|
||||
|
||||
func addParallax(to view: UIView) {
|
||||
|
||||
Generated
+4
-4
@@ -7,7 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
032FEB01E4C88E7C87032FCF9780FC7C /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F8B09C72B577EFDB20A3EFF4F0C668A /* UISideMenuNavigationController.swift */; };
|
||||
032FEB01E4C88E7C87032FCF9780FC7C /* SideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F8B09C72B577EFDB20A3EFF4F0C668A /* SideMenuNavigationController.swift */; };
|
||||
0D2D410A6087D4E0A54642165913EF30 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F10B146FA49E99D07F0FA0E38ABE8F /* Models.swift */; };
|
||||
0F9F3CABB81269CF711A73BAD21E7976 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; };
|
||||
287FA1360FD3EF72D700C54856C685C1 /* SideMenuManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE7B8C8447DD35D435B2AF4A23E221C /* SideMenuManager.swift */; };
|
||||
@@ -59,7 +59,7 @@
|
||||
61AFB3209BCB97295281AC6437FB346B /* SideMenuPresentationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuPresentationController.swift; path = Pod/Classes/SideMenuPresentationController.swift; sourceTree = "<group>"; };
|
||||
7825A90E082A1582EB16256B0E722B3F /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = "<group>"; };
|
||||
8428210022E0448700C6F2D8 /* Deprecations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Deprecations.swift; path = Pod/Classes/Deprecations.swift; sourceTree = "<group>"; };
|
||||
8F8B09C72B577EFDB20A3EFF4F0C668A /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = "<group>"; };
|
||||
8F8B09C72B577EFDB20A3EFF4F0C668A /* SideMenuNavigationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuNavigationController.swift; path = Pod/Classes/SideMenuNavigationController.swift; sourceTree = "<group>"; };
|
||||
9CF977D7FB42D367F2810037EBA59B7D /* SideMenu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SideMenu-dummy.m"; sourceTree = "<group>"; };
|
||||
9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
AB64592703EA9A196B5C0F07BA1A918A /* SideMenuInteractionController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuInteractionController.swift; path = Pod/Classes/SideMenuInteractionController.swift; sourceTree = "<group>"; };
|
||||
@@ -148,7 +148,7 @@
|
||||
61AFB3209BCB97295281AC6437FB346B /* SideMenuPresentationController.swift */,
|
||||
D154DB98A04C7BD96E4EFBBD3FE0008A /* SideMenuPresentationStyle.swift */,
|
||||
30C3188EE68841BE36716860BE079AF8 /* SideMenuTransitionController.swift */,
|
||||
8F8B09C72B577EFDB20A3EFF4F0C668A /* UISideMenuNavigationController.swift */,
|
||||
8F8B09C72B577EFDB20A3EFF4F0C668A /* SideMenuNavigationController.swift */,
|
||||
3ACA278071ED85D04DA83677D6C60528 /* UITableViewVibrantCell.swift */,
|
||||
);
|
||||
name = SideMenu;
|
||||
@@ -337,7 +337,7 @@
|
||||
614FC39555CB129D97FC24B2D953A427 /* SideMenuPresentationController.swift in Sources */,
|
||||
D0B45D0F0E7B359807CAFB744FB80CE4 /* SideMenuPresentationStyle.swift in Sources */,
|
||||
FCBFE25630B6309DF3213AE0F6F34D1A /* SideMenuTransitionController.swift in Sources */,
|
||||
032FEB01E4C88E7C87032FCF9780FC7C /* UISideMenuNavigationController.swift in Sources */,
|
||||
032FEB01E4C88E7C87032FCF9780FC7C /* SideMenuNavigationController.swift in Sources */,
|
||||
45A647715262A70BB9F2F4E7C1439C58 /* UITableViewVibrantCell.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
* [Code Implementation](#code-implementation)
|
||||
* **[Customization](#customization)**
|
||||
* [SideMenuManager](#sidemenumanager)
|
||||
* [UISideMenuNavigationController](#uisidemenunavigationcontroller)
|
||||
* [UISideMenuNavigationControllerDelegate](#uisidemenunavigationcontrollerdelegate)
|
||||
* [SideMenuNavigationController](#sidemenunavigationcontroller)
|
||||
* [SideMenuNavigationControllerDelegate](#sidemenunavigationcontrollerdelegate)
|
||||
* [Advanced](#advanced)
|
||||
* [Known Issues](#known-issues)
|
||||
* [Thank You](#thank-you)
|
||||
@@ -104,10 +104,10 @@ github "jonkykong/SideMenu" "master"
|
||||
|
||||
## Usage
|
||||
### Code-less Storyboard Implementation
|
||||
1. Create a Navigation Controller for a side menu. Set the `Custom Class` of the Navigation Controller to be `UISideMenuNavigationController` in the **Identity Inspector**. Set the `Module` to `SideMenu` (ignore this step if you've manually added SideMenu to your project). Create a Root View Controller for the Navigation Controller (shown as a UITableViewController below). Set up any Triggered Segues you want in that view controller.
|
||||
1. Create a Navigation Controller for a side menu. Set the `Custom Class` of the Navigation Controller to be `SideMenuNavigationController` in the **Identity Inspector**. Set the `Module` to `SideMenu` (ignore this step if you've manually added SideMenu to your project). Create a Root View Controller for the Navigation Controller (shown as a UITableViewController below). Set up any Triggered Segues you want in that view controller.
|
||||

|
||||
|
||||
2. Set the `Left Side` property of the `UISideMenuNavigationController` to On if you want it to appear from the left side of the screen, or Off/Default if you want it to appear from the right side.
|
||||
2. Set the `Left Side` property of the `SideMenuNavigationController` to On if you want it to appear from the left side of the screen, or Off/Default if you want it to appear from the right side.
|
||||

|
||||
|
||||
3. Add a UIButton or UIBarButton to a view controller that you want to display the menu from. Set that button's Triggered Segues action to modally present the Navigation Controller from step 1.
|
||||
@@ -123,10 +123,10 @@ import SideMenu
|
||||
From a button, do something like this:
|
||||
``` swift
|
||||
// Define the menu
|
||||
let menu = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration
|
||||
let menu = SideMenuNavigationController(rootViewController: YourViewController)
|
||||
// SideMenuNavigationController 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 menu = storyboard!.instantiateViewController(withIdentifier: "RightMenu") as! UISideMenuNavigationController
|
||||
// let menu = storyboard!.instantiateViewController(withIdentifier: "RightMenu") as! SideMenuNavigationController
|
||||
present(menu, animated: true, completion: nil)
|
||||
```
|
||||
|
||||
@@ -138,10 +138,10 @@ dismiss(animated: true, completion: nil)
|
||||
To use gestures you have to use the `SideMenuManager`. In your `AppDelegate` do something like this:
|
||||
``` swift
|
||||
// Define the menus
|
||||
let leftMenuNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
let leftMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController)
|
||||
SideMenuManager.default.leftMenuNavigationController = leftMenuNavigationController
|
||||
|
||||
let rightMenuNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
let rightMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController)
|
||||
SideMenuManager.default.rightMenuNavigationController = rightMenuNavigationController
|
||||
|
||||
// Setup gestures: the left and/or right menus must be set up (above) for these to work.
|
||||
@@ -160,9 +160,9 @@ That's it.
|
||||
`SideMenuManager` supports the following:
|
||||
``` swift
|
||||
/// The left menu.
|
||||
open var leftMenuNavigationController: UISideMenuNavigationController?
|
||||
open var leftMenuNavigationController: SideMenuNavigationController?
|
||||
/// The right menu.
|
||||
public var rightMenuNavigationController: UISideMenuNavigationController?
|
||||
public var rightMenuNavigationController: SideMenuNavigationController?
|
||||
/**
|
||||
Adds screen edge gestures for both left and right sides to a view to present a menu.
|
||||
|
||||
@@ -189,8 +189,8 @@ public var rightMenuNavigationController: UISideMenuNavigationController?
|
||||
*/
|
||||
@discardableResult public func addPanGestureToPresent(toView view: UIView) -> UIPanGestureRecognizer
|
||||
```
|
||||
#### UISideMenuNavigationController
|
||||
`UISideMenuNavigationController` supports the following:
|
||||
#### SideMenuNavigationController
|
||||
`SideMenuNavigationController` supports the following:
|
||||
``` swift
|
||||
/// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true.
|
||||
var allowPushOfSameClassTwice: Bool = true
|
||||
@@ -275,29 +275,29 @@ static let viewSlideOutMenuPartialOut: SideMenuPresentStyle
|
||||
/// The existing view slides out and shrinks to reveal the menu underneath.
|
||||
static let viewSlideOutMenuZoom: SideMenuPresentStyle
|
||||
```
|
||||
#### UISideMenuNavigationControllerDelegate
|
||||
To receive notifications when a menu is displayed from a view controller, have it adhere to the `UISideMenuNavigationControllerDelegate` protocol:
|
||||
#### SideMenuNavigationControllerDelegate
|
||||
To receive notifications when a menu is displayed from a view controller, have it adhere to the `SideMenuNavigationControllerDelegate` protocol:
|
||||
``` swift
|
||||
extension MyViewController: UISideMenuNavigationControllerDelegate {
|
||||
extension MyViewController: SideMenuNavigationControllerDelegate {
|
||||
|
||||
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuWillAppear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuDidAppear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appeared! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuWillDisappear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
func sideMenuDidDisappear(menu: SideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappeared! (animated: \(animated))")
|
||||
}
|
||||
}
|
||||
```
|
||||
*Note: setting the `sideMenuDelegate` property on `UISideMenuNavigationController` is optional. If your view controller adheres to the protocol then the methods will be called automatically.*
|
||||
*Note: setting the `sideMenuDelegate` property on `SideMenuNavigationController` is optional. If your view controller adheres to the protocol then the methods will be called automatically.*
|
||||
### Advanced
|
||||
<details>
|
||||
<summary>Click for Details</summary>
|
||||
@@ -309,9 +309,9 @@ For simplicity, `SideMenuManager.default` serves as the primary instance as most
|
||||
let customSideMenuManager = SideMenuManager()
|
||||
```
|
||||
2. Setup and display menus with your custom instance the same as you would with the `SideMenuManager.default` instance.
|
||||
3. If using Storyboards, subclass your instance of `UISideMenuNavigationController` and set its `sideMenuManager` property to your custom instance. This must be done before `viewDidLoad` is called:
|
||||
3. If using Storyboards, subclass your instance of `SideMenuNavigationController` and set its `sideMenuManager` property to your custom instance. This must be done before `viewDidLoad` is called:
|
||||
``` swift
|
||||
class MySideMenuNavigationController: UISideMenuNavigationController {
|
||||
class MySideMenuNavigationController: SideMenuNavigationController {
|
||||
|
||||
let customSideMenuManager = SideMenuManager()
|
||||
|
||||
@@ -322,10 +322,10 @@ class MySideMenuNavigationController: UISideMenuNavigationController {
|
||||
}
|
||||
}
|
||||
```
|
||||
Alternatively, you can set `sideMenuManager` from the view controller that segues to your UISideMenuNavigationController:
|
||||
Alternatively, you can set `sideMenuManager` from the view controller that segues to your SideMenuNavigationController:
|
||||
``` swift
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
if let sideMenuNavigationController = segue.destination as? UISideMenuNavigationController {
|
||||
if let sideMenuNavigationController = segue.destination as? SideMenuNavigationController {
|
||||
sideMenuNavigationController.sideMenuManager = customSideMenuManager
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "6.1.5"
|
||||
s.version = "6.2.4"
|
||||
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.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
842820FF22DDD24200C6F2D8 /* SideMenuInteractionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842820FE22DDD24200C6F2D8 /* SideMenuInteractionController.swift */; };
|
||||
8428210322E0449300C6F2D8 /* Deprecations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8428210222E0449300C6F2D8 /* Deprecations.swift */; };
|
||||
8432CC0422FFBCF5003D2BBD /* ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8432CC0322FFBCF5003D2BBD /* ExampleTests.swift */; };
|
||||
8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */; };
|
||||
8461A2D51E145A08001DA4F8 /* SideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D11E145A08001DA4F8 /* SideMenuNavigationController.swift */; };
|
||||
8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */; };
|
||||
84B489B51DD469B000D6CB43 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B21DD469B000D6CB43 /* LICENSE */; };
|
||||
84B489B71DD469B000D6CB43 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B41DD469B000D6CB43 /* README.md */; };
|
||||
@@ -75,7 +75,7 @@
|
||||
8432CC0122FFBCF4003D2BBD /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8432CC0322FFBCF5003D2BBD /* ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleTests.swift; sourceTree = "<group>"; };
|
||||
8432CC0522FFBCF5003D2BBD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = "<group>"; };
|
||||
8461A2D11E145A08001DA4F8 /* SideMenuNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuNavigationController.swift; path = Pod/Classes/SideMenuNavigationController.swift; sourceTree = "<group>"; };
|
||||
8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITableViewVibrantCell.swift; path = Pod/Classes/UITableViewVibrantCell.swift; sourceTree = "<group>"; };
|
||||
84B489B21DD469B000D6CB43 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||
84B489B41DD469B000D6CB43 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
@@ -137,7 +137,7 @@
|
||||
842820F022DDD1E800C6F2D8 /* SideMenuPresentationController.swift */,
|
||||
842820FC22DDD21100C6F2D8 /* SideMenuPresentationStyle.swift */,
|
||||
842820F222DDD1E800C6F2D8 /* SideMenuTransitionController.swift */,
|
||||
8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */,
|
||||
8461A2D11E145A08001DA4F8 /* SideMenuNavigationController.swift */,
|
||||
8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */,
|
||||
);
|
||||
name = Source;
|
||||
@@ -427,7 +427,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
842820EF22DDD1BC00C6F2D8 /* Protected.swift in Sources */,
|
||||
8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */,
|
||||
8461A2D51E145A08001DA4F8 /* SideMenuNavigationController.swift in Sources */,
|
||||
842820FD22DDD21100C6F2D8 /* SideMenuPresentationStyle.swift in Sources */,
|
||||
842820F822DDD1E800C6F2D8 /* SideMenuTransitionController.swift in Sources */,
|
||||
842820FF22DDD24200C6F2D8 /* SideMenuInteractionController.swift in Sources */,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 135 KiB |
Reference in New Issue
Block a user