Convert Figma logo to code with AI

jonkykong logoSideMenu

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

5,647
690
5,647
45

Top Related Projects

An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

iOS 7/8 style side menu with parallax effect.

A Control Center-esque control with blurred background and toggle animations.

Animated side menu with customizable UI

:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion

Quick Overview

SideMenu is a customizable side menu control for iOS applications written in Swift. It provides a simple and flexible way to implement sliding side menus in iOS apps, supporting both left and right side menus with various customization options.

Pros

  • Easy to integrate and use with a clean API
  • Highly customizable with numerous configuration options
  • Supports both left and right side menus
  • Compatible with Swift and Objective-C

Cons

  • Limited to iOS platform only
  • May require additional work to implement complex menu structures
  • Some users report issues with specific iOS versions or device orientations

Code Examples

  1. Basic setup of a left side menu:
let menu = SideMenuNavigationController(rootViewController: YourMenuViewController())
menu.leftSide = true
SideMenuManager.default.leftMenuNavigationController = menu
SideMenuManager.default.addPanGestureToPresent(toView: self.view)
  1. Customizing menu appearance:
menu.menuWidth = 300
menu.presentationStyle = .menuSlideIn
menu.statusBarEndAlpha = 0
  1. Presenting the side menu programmatically:
present(menu, animated: true, completion: nil)

Getting Started

  1. Install SideMenu using CocoaPods by adding to your Podfile:

    pod 'SideMenu'
    
  2. Import SideMenu in your view controller:

    import SideMenu
    
  3. Set up a basic side menu:

    let menu = SideMenuNavigationController(rootViewController: YourMenuViewController())
    SideMenuManager.default.leftMenuNavigationController = menu
    SideMenuManager.default.addPanGestureToPresent(toView: self.view)
    
  4. Present the menu:

    present(menu, animated: true, completion: nil)
    

Competitor Comparisons

An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

Pros of SlidingMenu

  • More established and mature project with a longer history
  • Supports both left and right sliding menus
  • Includes additional features like shadow effects and fade animations

Cons of SlidingMenu

  • No longer actively maintained (last commit in 2016)
  • Uses older Android development practices and may not be compatible with modern Android projects
  • Limited customization options compared to more recent libraries

Code Comparison

SlidingMenu:

SlidingMenu menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowWidthRes(R.dimen.shadow_width);
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);

SideMenu:

let menu = SideMenuNavigationController(rootViewController: YourViewController)
menu.leftSide = true
menu.presentationStyle = .menuSlideIn
menu.menuWidth = 300
SideMenuManager.default.addPanGestureToPresent(toView: self.view)

While both libraries provide sliding menu functionality, SlidingMenu is an older Android-specific library, whereas SideMenu is a more modern iOS-focused solution. SlidingMenu offers more built-in features but lacks recent updates, while SideMenu provides a simpler API with active maintenance and better integration with modern iOS development practices.

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

Pros of SlideMenuControllerSwift

  • More customizable appearance and behavior options
  • Supports both left and right side menus simultaneously
  • Includes built-in gesture recognizers for smoother interactions

Cons of SlideMenuControllerSwift

  • Less actively maintained (last update was in 2019)
  • Requires more setup and configuration compared to SideMenu
  • Limited documentation and examples available

Code Comparison

SlideMenuControllerSwift implementation:

let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftMenuViewController, rightMenuViewController: rightMenuViewController)
self.window?.rootViewController = slideMenuController
self.window?.makeKeyAndVisible()

SideMenu implementation:

let menu = SideMenuNavigationController(rootViewController: YourMenuViewController)
menu.leftSide = true
SideMenuManager.default.leftMenuNavigationController = menu
SideMenuManager.default.addPanGestureToPresent(toView: self.view)

Both libraries offer easy-to-use side menu implementations, but SlideMenuControllerSwift provides more flexibility at the cost of complexity. SideMenu is more actively maintained and has better documentation, making it easier for beginners to implement. The choice between the two depends on the specific requirements of your project and your familiarity with iOS development.

iOS 7/8 style side menu with parallax effect.

Pros of RESideMenu

  • More customizable appearance with built-in options for background images and blur effects
  • Supports both left and right side menus out of the box
  • Includes a demo project for quick implementation and testing

Cons of RESideMenu

  • Less actively maintained, with the last update being several years ago
  • Limited documentation and community support compared to SideMenu
  • May require more manual setup and configuration for advanced use cases

Code Comparison

RESideMenu:

RESideMenu *sideMenu = [[RESideMenu alloc] initWithContentViewController:contentViewController
                                                    leftMenuViewController:leftMenuViewController
                                                   rightMenuViewController:rightMenuViewController];
self.window.rootViewController = sideMenu;

SideMenu:

let menu = SideMenuNavigationController(rootViewController: YourMenuTableViewController())
menu.leftSide = true
SideMenuManager.default.leftMenuNavigationController = menu
SideMenuManager.default.addPanGestureToPresent(toView: self.navigationController!.navigationBar)

Both libraries offer straightforward implementation, but SideMenu's Swift-based approach may be more appealing for modern iOS development. RESideMenu's Objective-C code might be preferred for older projects or developers more comfortable with that language.

A Control Center-esque control with blurred background and toggle animations.

Pros of RNFrostedSidebar

  • Unique frosted glass effect for a visually appealing sidebar
  • Lightweight and easy to implement
  • Customizable blur radius and tint color

Cons of RNFrostedSidebar

  • Less actively maintained (last update in 2015)
  • Limited customization options compared to SideMenu
  • Lacks built-in support for right-side menu placement

Code Comparison

RNFrostedSidebar:

RNFrostedSidebar *callout = [[RNFrostedSidebar alloc] initWithImages:images selectedIndices:selectedIndices borderColors:colors];
callout.delegate = self;
[callout show];

SideMenu:

let menu = SideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.leftMenuNavigationController = menu
SideMenuManager.default.addPanGestureToPresent(toView: self.view)

RNFrostedSidebar offers a unique visual style with its frosted glass effect, making it stand out in terms of aesthetics. It's also lightweight and easy to implement. However, SideMenu provides more extensive customization options and active maintenance, making it a more versatile choice for long-term projects. SideMenu also offers built-in support for both left and right-side menu placement, which RNFrostedSidebar lacks. In terms of implementation, RNFrostedSidebar uses Objective-C while SideMenu is written in Swift, reflecting their respective ages and target audiences.

Animated side menu with customizable UI

Pros of Side-Menu.iOS

  • Visually appealing animations and transitions
  • Customizable menu styles and effects
  • Lightweight and easy to integrate

Cons of Side-Menu.iOS

  • Less actively maintained (last update in 2017)
  • Limited configuration options compared to SideMenu
  • Fewer features and less flexibility

Code Comparison

Side-Menu.iOS:

let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.menuLeftNavigationController = menuLeftNavigationController
SideMenuManager.default.menuPresentMode = .menuSlideIn

SideMenu:

let menu = SideMenuNavigationController(rootViewController: YourViewController)
menu.leftSide = true
menu.presentationStyle = .menuSlideIn
SideMenuManager.default.leftMenuNavigationController = menu

Both libraries offer similar basic setup, but SideMenu provides more configuration options and flexibility in its implementation. Side-Menu.iOS focuses on visual appeal and animations, while SideMenu offers a wider range of features and customization possibilities.

Side-Menu.iOS may be a good choice for projects prioritizing aesthetics and simplicity, whereas SideMenu is better suited for applications requiring more advanced functionality and ongoing support.

:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion

Pros of folding-cell

  • Unique and visually appealing animation effect for expanding cells
  • Customizable content for both folded and unfolded states
  • Supports Swift and can be easily integrated into iOS projects

Cons of folding-cell

  • Limited to a specific UI pattern, less versatile than a side menu
  • May require more complex setup for intricate designs
  • Potentially higher performance impact due to animations

Code Comparison

folding-cell:

let cell = FoldingCell()
cell.itemCount = 2
cell.setup(name: "Cell", duration: 0.5, backViewColor: .blue)
cell.selectedAnimation = .unfold
cell.backgroundView = UIView()

SideMenu:

let menu = SideMenuNavigationController(rootViewController: YourViewController())
menu.leftSide = true
menu.presentationStyle = .menuSlideIn
menu.menuWidth = 280
SideMenuManager.default.leftMenuNavigationController = menu

Summary

While folding-cell offers an innovative and eye-catching UI element for expanding cells, SideMenu provides a more traditional and versatile navigation solution. folding-cell excels in creating engaging list views with expandable content, whereas SideMenu is better suited for overall app navigation and menu structures. The choice between the two depends on the specific UI requirements and design goals of your iOS application.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

▤ 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 OutSlide InDissolveSlide 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.