Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.

Overview

▤ SideMenu

CircleCI Version Carthage compatible License Platform

If you like SideMenu, give it a ★ at the top right of this page.

SideMenu needs your help! If you're a skilled iOS developer and want to help maintain this repository and answer issues asked by the community, please send me an email.

Hi, I'm Jon Kent and I am an iOS designer, developer, and mobile strategist. I love coffee and play the drums.

  • Hire me to help you make cool stuff. Note: If you're having a problem with SideMenu, please open an issue and do not email me.
  • Check out my website to see some of my other projects.
  • Building and maintaining this free library takes a lot of my time and saves you time. Please consider paying it forward by supporting me with a small amount to my PayPal. (only 13 people have donated since 12/23/15 but thank you to those who have!)

Overview

SideMenu is a simple and versatile side menu control written in Swift.

  • It can be implemented in storyboard without a single line of code.
  • Eight standard animation styles to choose from (there's even a parallax effect if you want to get weird).
  • Highly customizable without needing to write tons of custom code.
  • Supports continuous swiping between side menus on boths sides in a single gesture.
  • Global menu configuration. Set-up once and be done for all screens.
  • Menus can be presented and dismissed the same as any other view controller since this control uses custom transitions.
  • Animations use your view controllers, not snapshots.
  • Properly handles screen rotation and in-call status bar height changes.

Check out the example project to see it in action!

Preview Samples

Slide Out Slide In Dissolve Slide In + Out

Requirements

  • Xcode 11.
  • Swift 5.
  • iOS 10 or higher.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SideMenu into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

pod 'SideMenu'

# For Swift 5 use:
# pod 'SideMenu', '~> 6.0'

# For Swift 4.2 (no longer maintained) use:
# pod 'SideMenu', '~> 5.0'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SideMenu into your Xcode project using Carthage, specify it in your Cartfile:

github "jonkykong/SideMenu" "master"

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but SideMenu does support its use on supported platforms.

Once you have your Swift package set up, adding SideMenu as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/jonkykong/SideMenu.git", from: "6.0.0")
]

Usage

Code-less Storyboard Implementation

  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 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.

That's it. Note: you can only enable gestures in code.

Code Implementation

First:

import SideMenu

From a button, do something like this:

// Define the menu
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! SideMenuNavigationController
present(menu, animated: true, completion: nil)

To dismiss a menu programmatically, do something like this:

dismiss(animated: true, completion: nil)

To use gestures you have to use the SideMenuManager. In your AppDelegate do something like this:

// Define the menus
let leftMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.leftMenuNavigationController = leftMenuNavigationController

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.
// Note that these continue to work on the Navigation Controller independent of the view controller it displays!
SideMenuManager.default.addPanGestureToPresent(toView: self.navigationController!.navigationBar)
SideMenuManager.default.addScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)

// (Optional) Prevent status bar area from turning black when menu appears:
leftMenuNavigationController.statusBarEndAlpha = 0
// Copy all settings to the other menu
rightMenuNavigationController.settings = leftMenuNavigationController.settings

That's it.

Customization

SideMenuManager

SideMenuManager supports the following:

/// The left menu.
open var leftMenuNavigationController: SideMenuNavigationController?
/// The right menu.
public var rightMenuNavigationController: SideMenuNavigationController?
/**
 Adds screen edge gestures for both left and right sides to a view to present a menu.

 - Parameter toView: The view to add gestures to.

 - Returns: The array of screen edge gestures added to `toView`.
 */
@discardableResult public func addScreenEdgePanGesturesToPresent(toView view: UIView) -> [UIScreenEdgePanGestureRecognizer]
/**
 Adds screen edge gestures to a view to present a menu.

 - Parameter toView: The view to add gestures to.
 - Parameter forMenu: The menu (left or right) you want to add a gesture for.

 - Returns: The screen edge gestures added to `toView`.
 */
@discardableResult public func addScreenEdgePanGesturesToPresent(toView view: UIView, forMenu side: PresentDirection) -> UIScreenEdgePanGestureRecognizer
/**
 Adds a pan edge gesture to a view to present menus.

 - Parameter toView: The view to add a pan gesture to.

 - Returns: The pan gesture added to `toView`.
 */
@discardableResult public func addPanGestureToPresent(toView view: UIView) -> UIPanGestureRecognizer

SideMenuNavigationController

SideMenuNavigationController supports the following:

/// 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
/// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation.
var alwaysAnimate: Bool = true
/// The animation options when a menu is displayed. Ignored when displayed with a gesture.
var animationOptions: UIView.AnimationOptions = .curveEaseInOut
/**
 The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController.

 - Note: If you want cells in a UITableViewController menu to show vibrancy, make them a subclass of UITableViewVibrantCell.
 */
var blurEffectStyle: UIBlurEffect.Style? = nil
/// Duration of the remaining animation when the menu is partially dismissed with gestures. Default is 0.35 seconds.
var completeGestureDuration: Double = 0.35
/// Animation curve of the remaining animation when the menu is partially dismissed with gestures. Default is .easeIn.
var completionCurve: UIView.AnimationCurve = .curveEaseInOut
/// Duration of the animation when the menu is dismissed without gestures. Default is 0.35 seconds.
var dismissDuration: Double = 0.35
/// Automatically dismisses the menu when another view is presented from it.
var dismissOnPresent: Bool = true
/// Automatically dismisses the menu when another view controller is pushed from it.
var dismissOnPush: Bool = true
/// Automatically dismisses the menu when the screen is rotated.
var dismissOnRotation: Bool = true
/// Automatically dismisses the menu when app goes to the background.
var dismissWhenBackgrounded: Bool = true
/// Enable or disable a swipe gesture that dismisses the menu. Will not be triggered when `presentingViewControllerUserInteractionEnabled` is set to true. Default is true.
var enableSwipeToDismissGesture: Bool = true
/// Enable or disable a tap gesture that dismisses the menu. Will not be triggered when `presentingViewControllerUserInteractionEnabled` is set to true. Default is true.
var enableTapToDismissGesture: Bool = true
/// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
var initialSpringVelocity: CGFloat = 1
/// 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.
var leftSide: Bool = false
/// Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is zero.
var menuWidth: CGFloat = 240
/// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds.
var presentDuration: Double = 0.35
/// Enable or disable interaction with the presenting view controller while the menu is displayed. Enabling may make it difficult to dismiss the menu or cause exceptions if the user tries to present and already presented menu. `presentingViewControllerUseSnapshot` must also set to false. Default is false.
var presentingViewControllerUserInteractionEnabled: Bool = false
/// Use a snapshot for the presenting vierw controller while the menu is displayed. Useful when layout changes occur during transitions. Not recommended for apps that support rotation. Default is false.
var presentingViewControllerUseSnapshot: Bool = false
/// The presentation style of the menu.
var presentationStyle: SideMenuPresentStyle = .viewSlideOut
/**
 The push style of the menu.

 There are six modes in MenuPushStyle:
 - defaultBehavior: The view controller is pushed onto the stack.
 - popWhenPossible: If a view controller already in the stack is of the same class as the pushed view controller, the stack is instead popped back to the existing view controller. This behavior can help users from getting lost in a deep navigation stack.
 - preserve: If a view controller already in the stack is of the same class as the pushed view controller, the existing view controller is pushed to the end of the stack. This behavior is similar to a UITabBarController.
 - preserveAndHideBackButton: Same as .preserve and back buttons are automatically hidden.
 - replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved..
 - subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu.  Use this behavior if you want to display a sub menu.
 */
var pushStyle: MenuPushStyle = .default
/// Draws `presentationStyle.backgroundColor` behind the status bar. Default is 0.
var statusBarEndAlpha: CGFloat = 0
/// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture.
var usingSpringWithDamping: CGFloat = 1
/// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller.
var isHidden: Bool

SideMenuPresentStyle

There are 8 pre-defined SideMenuPresentStyle options:

/// Menu slides in over the existing view.
static let menuSlideIn: SideMenuPresentStyle
/// The existing view slides out to reveal the menu underneath.
static let viewSlideOut: SideMenuPresentStyle
/// The existing view slides out while the menu slides in.
static let viewSlideOutMenuIn: SideMenuPresentStyle
/// The menu dissolves in over the existing view.
static let menuDissolveIn: SideMenuPresentStyle
/// The existing view slides out while the menu partially slides in.
static let viewSlideOutMenuPartialIn: SideMenuPresentStyle
/// The existing view slides out while the menu slides out from under it.
static let viewSlideOutMenuOut: SideMenuPresentStyle
/// The existing view slides out while the menu partially slides out from under it.
static let viewSlideOutMenuPartialOut: SideMenuPresentStyle
/// The existing view slides out and shrinks to reveal the menu underneath.
static let viewSlideOutMenuZoom: SideMenuPresentStyle

SideMenuNavigationControllerDelegate

To receive notifications when a menu is displayed from a view controller, have it adhere to the SideMenuNavigationControllerDelegate protocol:

extension MyViewController: SideMenuNavigationControllerDelegate {

    func sideMenuWillAppear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Appearing! (animated: \(animated))")
    }

    func sideMenuDidAppear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Appeared! (animated: \(animated))")
    }

    func sideMenuWillDisappear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Disappearing! (animated: \(animated))")
    }

    func sideMenuDidDisappear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Disappeared! (animated: \(animated))")
    }
}

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

Click for Details

Multiple SideMenuManagers

For simplicity, SideMenuManager.default serves as the primary instance as most projects will only need one menu across all screens. If you need to show a different SideMenu using gestures, such as from a modal view controller presented from a previous SideMenu, do the following:

  1. Declare a variable containing your custom SideMenuManager instance. You may want it to define it globally and configure it in your app delegate if menus will be used on multiple screens.
let customSideMenuManager = SideMenuManager()
  1. Setup and display menus with your custom instance the same as you would with the SideMenuManager.default instance.
  2. 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:
class MySideMenuNavigationController: SideMenuNavigationController {

    let customSideMenuManager = SideMenuManager()

    override func awakeFromNib() {
        super.awakeFromNib()

        sideMenuManager = customSideMenuManager
    }
}

Alternatively, you can set sideMenuManager from the view controller that segues to your SideMenuNavigationController:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if let sideMenuNavigationController = segue.destination as? SideMenuNavigationController {
        sideMenuNavigationController.sideMenuManager = customSideMenuManager
    }
}

Important: displaying SideMenu instances directly over each other is not supported. Use menuPushStyle = .subMenu to display multi-level menus instead.

SideMenuPresentationStyle

If you want to create your own custom presentation style, create a subclass of SideMenuPresentationStyle and set your menu's presentationStyle to it:

class MyPresentStyle: SideMenuPresentationStyle {

    override init() {
        super.init()
        /// Background color behind the views and status bar color
        backgroundColor = .black
        /// The starting alpha value of the menu before it appears
        menuStartAlpha = 1
        /// Whether or not the menu is on top. If false, the presenting view is on top. Shadows are applied to the view on top.
        menuOnTop = false
        /// The amount the menu is translated along the x-axis. Zero is stationary, negative values are off-screen, positive values are on screen.
        menuTranslateFactor = 0
        /// The amount the menu is scaled. Less than one shrinks the view, larger than one grows the view.
        menuScaleFactor = 1
        /// The color of the shadow applied to the top most view.
        onTopShadowColor = .black
        /// The radius of the shadow applied to the top most view.
        onTopShadowRadius = 5
        /// The opacity of the shadow applied to the top most view.
        onTopShadowOpacity = 0
        /// The offset of the shadow applied to the top most view.
        onTopShadowOffset = .zero
        /// The ending alpha of the presenting view when the menu is fully displayed.
        presentingEndAlpha = 1
        /// The amount the presenting view is translated along the x-axis. Zero is stationary, negative values are off-screen, positive values are on screen.
        presentingTranslateFactor = 0
        /// The amount the presenting view is scaled. Less than one shrinks the view, larger than one grows the view.
        presentingScaleFactor = 1
        /// The strength of the parallax effect on the presenting view once the menu is displayed.
        presentingParallaxStrength = .zero
    }

    /// This method is called just before the presentation transition begins. Use this to setup any animations. The super method does not need to be called.
    override func presentationTransitionWillBegin(to presentedViewController: UIViewController, from presentingViewController: UIViewController) {}
    /// This method is called during the presentation animation. Use this to animate anything alongside the menu animation. The super method does not need to be called.
    override func presentationTransition(to presentedViewController: UIViewController, from presentingViewController: UIViewController) {}
    /// This method is called when the presentation transition ends. Use this to finish any animations. The super method does not need to be called.
    override func presentationTransitionDidEnd(to presentedViewController: UIViewController, from presentingViewController: UIViewController, _ completed: Bool) {}
    /// This method is called just before the dismissal transition begins. Use this to setup any animations. The super method does not need to be called.
    override func dismissalTransitionWillBegin(to presentedViewController: UIViewController, from presentingViewController: UIViewController) {}
    /// This method is called during the dismissal animation. Use this to animate anything alongside the menu animation. The super method does not need to be called.
    override func dismissalTransition(to presentedViewController: UIViewController, from presentingViewController: UIViewController) {}
    /// This method is called when the dismissal transition ends. Use this to finish any animations. The super method does not need to be called.
    override func dismissalTransitionDidEnd(to presentedViewController: UIViewController, from presentingViewController: UIViewController, _ completed: Bool) {}
}

Known Issues

  • Issue #258. Using presentingViewControllerUseSnapshot can help preserve the experience.

Thank You

A special thank you to everyone that has contributed to this library to make it better. Your support is appreciated!

License

SideMenu is available under the MIT license. See the LICENSE file for more info.

Comments
  • Crash when presenting UISideMenuNavigationController under specific circumstances

    Crash when presenting UISideMenuNavigationController under specific circumstances

    I have detected a problem (well, not me, my users did) when presenting a UISideMenuNavigationController in a specific scenario.

    This happens if I do the following steps:

    • Present the UISideMenuNavigationController (with a gesture or pressing a button... it's indifferent)
    • From this UISideMenuNavigationController, I present a view controller (e.g.: UIAlertViewController or MFMailComposeViewController)
    • While this view controller is showing, I press the home button
    • I go back to the app
    • At this moment, the UISideMenuNavigationController is hidden and looks like the view controller I presented is... dismissed?
    • Now, if I try to present the UISideMenuNavigationController again... crash!

    And this is the crash log:

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <App.SideMenuViewController: 0x1f12dba0>.'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x09504212 __exceptionPreprocess + 194
    	1   libobjc.A.dylib                     0x08ba8e66 objc_exception_throw + 52
    	2   UIKit                               0x05456975 -[UIViewController _presentViewController:withAnimationController:completion:] + 5740
    	3   UIKit                               0x05459b5a __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 363
    	4   UIKit                               0x05459ec3 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 535
    	5   UIKit                               0x054599a8 -[UIViewController presentViewController:animated:completion:] + 182
    	6   SideMenu                            0x04f5017c _TZFC8SideMenu18SideMenuTransition20handlePresentMenuPanfCSo22UIPanGestureRecognizerT_ + 2284
    	7   SideMenu                            0x04f4f74c _TZFC8SideMenu18SideMenuTransition31handlePresentMenuLeftScreenEdgefCSo32UIScreenEdgePanGestureRecognizerT_ + 76
    	8   SideMenu                            0x04f4f7e7 _TToZFC8SideMenu18SideMenuTransition31handlePresentMenuLeftScreenEdgefCSo32UIScreenEdgePanGestureRecognizerT_ + 55
    	9   UIKit                               0x058304c7 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64
    	10  UIKit                               0x05838eea _UIGestureRecognizerSendTargetActions + 109
    	11  UIKit                               0x0583657a _UIGestureRecognizerSendActions + 288
    	12  UIKit                               0x05835434 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1059
    	13  UIKit                               0x0581fe74 _UIGestureEnvironmentUpdate + 1461
    	14  UIKit                               0x0581f877 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 494
    	15  UIKit                               0x0581ea21 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 259
    	16  UIKit                               0x052ee3b3 -[UIWindow sendEvent:] + 4276
    	17  UIKit                               0x05294d88 -[UIApplication sendEvent:] + 395
    	18  UIKit                               0x05b3c25d __dispatchPreprocessedEventFromEventQueue + 3706
    	19  UIKit                               0x05b3433f __handleEventQueue + 5345
    	20  CoreFoundation                      0x094a3cbf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    	21  CoreFoundation                      0x09487df7 __CFRunLoopDoSources0 + 519
    	22  CoreFoundation                      0x09487284 __CFRunLoopRun + 1124
    	23  CoreFoundation                      0x09486bab CFRunLoopRunSpecific + 395
    	24  CoreFoundation                      0x09486a0b CFRunLoopRunInMode + 123
    	25  GraphicsServices                    0x0bb7fb4c GSEventRunModal + 177
    	26  GraphicsServices                    0x0bb7f9c7 GSEventRun + 80
    	27  UIKit                               0x0527432b UIApplicationMain + 148
    	28  MyApp                               0x0011d3e1 main + 145
    	29  libdyld.dylib                       0x0ac10799 start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    
    opened by waninkoko 38
  • Circular Reference on Xcode 11.4

    Circular Reference on Xcode 11.4

    I have read the guidelines for contributing and I understand

    • [x] My issue is happening in the latest version of SideMenu (older versions are no longer maintained).
    • [ ] My issue was not solved in the README.
    • [ ] My issue can not be answered on stackoverflow.com.
    • [ ] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    • [ ] My issue is reproducible in the demo project.

    Describe the bug When compiled using Xcode 11.4, it throws a Circular reference error. Screen Shot 2020-03-25 at 3 20 00 PM

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Additional context Add any other context about the problem here.

    Bug - Help Wanted! 
    opened by lawgimenez 27
  • When side menu is presented, the status bar turns black (except for green charging batter)

    When side menu is presented, the status bar turns black (except for green charging batter)

    New Issue Checklist

    I have read the guidelines for contributing and I understand:

    • [x ] My issue is happening in the latest version of SideMenu.
    • [ x] My issue was not solved in the README.
    • [?] My issue can not be answered on stackoverflow.com.
    • [x] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    • [?] My issue is reproducible in the demo project.

    Issue Description

    When I modally present (programmatically) the side menu, the status turns completely black, until the side menu is hidden again. However the green battery icon still shows)

    opened by WillBishop 24
  • Pushing UIViewController from SideMenu sometimes blinks/flashes

    Pushing UIViewController from SideMenu sometimes blinks/flashes

    Describe the bug I use SideMenu to show a UITableView with 4 different options for the user to navigate to and another UITableViewCell to log out. This all works correctly, however, since iOS 13, when one of the 4 UIViewControllers is pushed, sometimes a short blink/flash appears right after the UIViewController was shown. I have tried to navigate in other ways outside of SideMenu, and this problem doesn't happen when pushing regularly, making me think the bug is associated with SideMenu.

    To Reproduce Steps to reproduce the behavior:

    1. I instantiate SideMenu as follows:
    var sideMenuManager = SideMenuManager.init()
    var sideMenuController = SideMenuController()
    
    menuLeftNavigationController = SideMenuNavigationController(rootViewController: sideMenuController)
    sideMenuManager.leftMenuNavigationController = menuLeftNavigationController
                                    
    menuLeftNavigationController.menuWidth = max(round(sideMenuWidth), 240)
    menuLeftNavigationController.dismissOnPush = true
    menuLeftNavigationController.statusBarEndAlpha = 0
    menuLeftNavigationController.presentationStyle = .viewSlideOutMenuIn
    menuLeftNavigationController.presentationStyle.presentingEndAlpha = 0.5
    
    sideMenuManager.addScreenEdgePanGesturesToPresent(toView: navView)
    
    1. To push a UIViewController, I use the following code inside my Side Menu ViewController (SideMenuController):
    let pushVC = MyCustomViewController()
    let navViewController = self.navigationController
    navViewController?.pushViewController(pushVC, animated: true)
    
    1. When the UIViewController shows, most of the time it's OK, but in 1 out of every 5 cases or so, a short blink or flash appears on the screen for a couple of milliseconds.

    Expected behavior Before iOS 13, this was all working smoothly, without blinks/flashes. Was hoping I was able to go back to the smooth-running pushes.

    Bug - Help Wanted! 
    opened by pennywise94 21
  • Application crashes after touch home button

    Application crashes after touch home button

    Application crashes for me after touching home button.In SideMenuTransition.hideMenuStart() SideMenuTransition.viewControllerForPresentedMenu! controller is nil. My init looks like:

     let leftViewController:UISideMenuNavigationController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("UISideMenuNavigationController") as! UISideMenuNavigationController
             SideMenuManager.menuLeftNavigationController = leftViewController
            SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.view)
            SideMenuManager.menuPresentMode = .MenuSlideIn
            SideMenuManager.menuAnimationBackgroundColor = UIColor.clearColor()
    
    opened by mkuprianowicz 21
  • Set content of the menu programmatically

    Set content of the menu programmatically

            let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: SideMenuViewController())
            menuLeftNavigationController.leftSide = true
            // UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here like setting its viewControllers.
            SideMenuManager.menuLeftNavigationController = menuLeftNavigationController
    

    The code above let me open the side menu, but its empty. It should have root controller = SideMenuViewController(). It never loaded.

    I tested SideMenuViewController and it display just fine anywhere else.

    opened by thang2410199 18
  • Problem with the selection of tableview item

    Problem with the selection of tableview item

    New Issue Checklist

    I have read the guidelines for contributing and I understand:

    • [x] My issue is happening in the latest version of SideMenu.
    • [x] My issue was not solved in the README.
    • [ ] My issue can not be answered on stackoverflow.com.
    • [x] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    • [x] My issue is reproducible in the demo project.

    Issue Description

    ezgif com-video-to-gif 1

    Hello! Please help me. I have problem: if I do starting to swipe side menu, table view item don't react on tap in first time

    opened by onsissond 17
  • Problem about push viewController from root viewcontroller of sideMunu

    Problem about push viewController from root viewcontroller of sideMunu

    In Objective-C, when i push viewController with code [self.navigationController pushViewController:viewController animated:YES], Xcode appears warning:SideMenu Warning: attempt to push a View Controller from Optional(<UITabBarController: 0x127a6d800>) where its navigationController == nil. It must be embedded in a Navigation Controller for this to work. How to push view controller in Objective-C?

    opened by ricpi 17
  • Setting Swipe Gestures to Nil Doesn't Disable Swipe Gesture

    Setting Swipe Gestures to Nil Doesn't Disable Swipe Gesture

            conversationsViewController.conversationsViewControllerDelegate = self
            SideMenuManager.menuLeftNavigationController = conversationsViewController
            SideMenuManager.menuPresentMode = .ViewSlideInOut
            SideMenuManager.menuFadeStatusBar = false
            SideMenuManager.menuWidth = max(round(min(UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height) * 0.85), 240)
            SideMenuManager.menuShadowOpacity = 0
            SideMenuManager.menuRightSwipeToDismissGesture = nil
            SideMenuManager.menuLeftSwipeToDismissGesture = nil
            SideMenuManager.menuAnimationPresentDuration = 0.25
            SideMenuManager.menuAnimationDismissDuration = 0.25
    

    As you can see I've set both swipe gestures to nil however, I'm still able to swipe and dismiss the controller. What am I doing wrong?

    opened by mbalex99 17
  • Present View Controller from side menu

    Present View Controller from side menu

    What is the appropriate way to present a view controller from the menu when a row is selected (using TableViewController? Right now I am pushing modally (cover up presentation) based on the selected row, but I'd prefer it to just change whatever controller that was pushed to the side when the menu is displayed and then hide the menu when the row is selected.

    Does that make sense?

    opened by dtfiedler 17
  • Regression in 2.3.3 viewWillAppear not called

    Regression in 2.3.3 viewWillAppear not called

    New Issue Checklist

    I have read the guidelines for contributing and I understand:

    • [x] My issue is happening in the latest version of SideMenu.
    • [x] My issue was not solved in the README.
    • [x] My issue can not be answered on stackoverflow.com.
    • [x] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    • [ ] My issue is reproducible in the demo project.

    Issue Description

    viewWillAppear on menu's table view is called properly only on first appearance. After that, it is not called before menu appears but only after it disappears.

    The Example project is based on storyboards, but this issue appears when I setup menu in code. Here is very basic project with menu setup code taken from README: https://github.com/paiv/sidemenuappear/blob/master/sidemenuappear/ViewController.swift

    opened by paiv 15
  • On iPad, viewDidAppear and viewWillAppear are called when dismiss is called, but not on iPhone.

    On iPad, viewDidAppear and viewWillAppear are called when dismiss is called, but not on iPhone.

    I am using the latest version 6.5.0. It is based on iPhone. When I go to SecondView through the side menu in MainView, viewWillAppear and viewDidAppear are not called in MainView after calling dismiss in SecondView. It works on iPad, but not on iPhone. What should I do?

    Bug - Help Wanted! 
    opened by shoon0224 0
  • Pushing UIViewController from SideMenu sometimes blinks/flashes This bugs has no fix at 6.5.0

    Pushing UIViewController from SideMenu sometimes blinks/flashes This bugs has no fix at 6.5.0

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at:indexPath,动画:true) let starVc = TDViewController() starVc.hidesBottomBarWhenPushed = true navigationController?.pushViewController(starVc,动画:true) } 当我从侧栏的页面中didseleted方法中push一个新页面,这样做会出现闪烁。类似有个黑色的遮罩遮住了页面零点几秒,在不同的页面之前push时发生概率大点。每次App重新运行后也可以复现,但当我推了几次页面后,这个问题就自己消失了。

    Bug - Help Wanted! 
    opened by northcity 2
  • Side menu tab bar overlaps with the presenting vc's tab bar during transitions.

    Side menu tab bar overlaps with the presenting vc's tab bar during transitions.

    I have read the guidelines for contributing and I understand

    • [true ] My issue is happening in the latest version of SideMenu (older versions are no longer maintained).
    • [true ] My issue was not solved in the README.
    • [true ] My issue can not be answered on stackoverflow.com.
    • [true ] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    • [true ] My issue is reproducible in the demo project.

    Describe the bug Presented menu table view's tab bar over laps with the presenting view controller's tab bar during presentation/dismissal transitions.

    To Reproduce Steps to reproduce the behavior: import SideMenu

    var menu: SideMenuNavigationController? - (global variable) setupSideMenu() - (called in view did load)

    private func setupSideMenu() { menu = SideMenuNavigationController(rootViewController: PopyaPlusViewController()) SideMenuManager.default.leftMenuNavigationController = menu }

    • (Method to present menu vc) @IBAction func popyaPlusBtnTapped(_ sender: UIButton) { guard let menu = menu else { return } present(menu, animated: true, completion: nil) }

    • (Main methods in menu table vc) override func viewDidLoad() { super.viewDidLoad() tableView.register(UINib(nibName: "SideMenuTableViewCell", bundle: nil), forCellReuseIdentifier: "Cell") }

      override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.navigationBar.isTranslucent = true setupTableView() }

      func setupTableView() { navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(systemName: "info.circle"), style: .plain, target: self, action: #selector(infoBtnTapped)) tableView.backgroundColor = .white tableView.showsVerticalScrollIndicator = false tableView.allowsSelection = false self.tabBarController?.tabBar.isTranslucent = true }

    Expected behavior I expect the tab bars overlapping behaviour not to happen as it seem to prevent taps on the presenting vc tab bar items not to be recognised (sometimes).

    Screenshots image_123986672-3

    image_123986672-2

    image_123986672

    Additional context I am using Xcode 13.1, - iPhone XR

    Bug - Help Wanted! 
    opened by ElrB 1
  • The side menu appears invisible on the iphone XR

    The side menu appears invisible on the iphone XR

    I have read the guidelines for contributing and I understand iOS Version 15.4

    • [ ] My issue is happening in the 6.5.0 of SideMenu (older versions are no longer maintained). Describe the bug On the iphone XR the sidemenu does not appear

    To Reproduce Steps to reproduce the behavior: navigationController.present(SideMenuManager.default.rightMenuNavigationController!, animated: true)

    Expected behavior In the other devices when making the present it appears correctly.

    Bug - Help Wanted! 
    opened by RapsusMTN 0
  • It crashed in iOS 12.4   pod version 5.0.3 6.0.9 and latest version

    It crashed in iOS 12.4 pod version 5.0.3 6.0.9 and latest version

    I have read the guidelines for contributing and I understand

    • [x] My issue is happening in the latest version of SideMenu (older versions are no longer maintained).
    • [x] My issue was not solved in the README.
    • [ ] My issue can not be answered on stackoverflow.com.
    • [ ] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    • [ ] My issue is reproducible in the demo project.

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Additional context Add any other context about the problem here.

    Bug - Help Wanted! 
    opened by zjz2020 0
Owner
Jon Kent
Freelance Designer & iOS Developer. Hire me to help you make cool stuff.
Jon Kent
A Slide Menu, written in Swift, inspired by Slide Menu Material Design

Swift-Slide-Menu (Material Design Inspired) A Slide Menu, written in Swift 2, inspired by Navigation Drawer on Material Design (inspired by Google Mat

Boisney Philippe 90 Oct 17, 2020
SwiftySideMenu is a lightweight and easy to use side menu controller to add left menu and center view controllers with scale animation based on Pop framework.

SwiftySideMenu SwiftySideMenu is a lightweight, fully customizable, and easy to use controller to add left menu and center view controllers with scale

Hossam Ghareeb 84 Feb 4, 2022
Left Side Menu \ Side Bar with modern interface for iOS

SideMenu A customizable, interactive, auto expanding and collapsing side menu fo

Mohammed Albahal 0 Dec 18, 2021
Hamburger Menu Button - A hamburger menu button with full customization

Hamburger Menu Button A hamburger menu button with full customization. Inspired by VinhLe's idea on the Dribble How to use it You can config the looks

Toan Nguyen 114 Jun 12, 2022
Simple side option menu with clean code princibles

SwiftUISideMenu Simple side option menu with clean code princibles.

Mehmet Karanlık 12 May 23, 2022
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

Yuji Hato 3.3k Dec 29, 2022
SwiftBar - Powerful macOS menu bar customization tool

SwiftBar - Powerful macOS menu bar customization tool

SwiftBar 2k Jan 8, 2023
This is a spring slide menu for iOS apps - 一个弹性侧滑菜单

LLSlideMenu This is a spring slide menu for iOS apps 一个弹性侧滑菜单 弹性动画原理借鉴该项目中阻尼函数实现 Preview 预览 Installation 安装 pod 1.pod 'LLSlideMenu', '~> 1.0.6'

Li Lei 590 Dec 7, 2022
iOS Slide Menu Controller. It is written in pure swift.

SlideMenuController Requirements iOS 9+ Installation SlideMenuController is available through CocoaPods. To install it, simply add the following line

Myung gi son 40 Jan 16, 2022
Slide Menu (Drawer) in Swift

AKSwiftSlideMenu Slide Menu (Drawer) in Swift 5.0 Why to use a library everytime? Let's create our own Slide Menu in Swift 5.0 I have uploaded a video

Ashish Kakkad 281 Jan 5, 2023
Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶

RHSideButtons ?? Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app

Robert Herdzik 166 Nov 14, 2022
A simple side menu for iOS written in Swift.

ENSwiftSideMenu A lightweight flyover side menu component for iOS with the UIDynamic's bouncing animation, UIGestures and UIBlurEffect. Allows you to

Evgeny Nazarov 1.8k Dec 21, 2022
A simple customizable side menu written in SwiftUI.

NSideMenu Description A simple customizable side menu written in SwiftUI. Give a Star! ⭐ Feel free to request an issue on github if you find bugs or r

null 5 Oct 10, 2022
iOS Interactive Side Menu written in Swift.

Interactive Side Menu A customizable, interactive, auto expanding and collapsing side menu for iOS written in Swift. Here are some of the ways Interac

Handsome 706 Dec 15, 2022
iOS 7/8 style side menu with parallax effect.

RESideMenu iOS 7/8 style side menu with parallax effect inspired by Dribbble shots (first and second). Since version 4.0 you can add menu view control

Roman Efimov 7.2k Dec 28, 2022
A side menu controller written in Swift for iOS

Description SideMenuController is a custom container view controller written in Swift which will display the main content within a center panel and th

Teo 1.2k Dec 29, 2022
Beautiful iOS side menu library with parallax effect. Written in Swift

AKSideMenu AKSideMenu is a double side menu library with parallax effect. Example Project See the contained examples to get a sample of how AKSideMenu

Diogo Autilio 280 Dec 6, 2022
Control your display's brightness from the macOS menu bar. Simple and easy to use.

MonitorControl Lite Control your display's brightness from the macOS menu bar. Simple and easy to use. About MonitorControl Lite is a simplified versi

null 62 Dec 11, 2022
Animated side menu with customizable UI

Side Menu Animated side menu with customizable UI. Made in Yalantis. Check this project on dribbble. Check this project on Behance. Requirements iOS 7

Yalantis 2.7k Dec 27, 2022