iOS 7/8 style side menu with parallax effect.

Related tags

Menu RESideMenu
Overview

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 controllers on both left and right sides of your content view controller.

RESideMenu Screenshot

RESideMenu Screenshot

Requirements

  • Xcode 6 or higher
  • Apple LLVM compiler
  • iOS 6.0 or higher
  • ARC

Demo

Build and run the RESideMenuExample project in Xcode to see RESideMenu in action. For storyboards integration demo, build and run RESideMenuStoryboardsExample.

Installation

CocoaPods

The recommended approach for installating RESideMenu is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation. For best results, it is recommended that you install via CocoaPods >= 0.28.0 using Git >= 1.8.0 installed via Homebrew.

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Change to the directory of your Xcode project:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile

Edit your Podfile and add RESideMenu:

platform :ios, '6.0'
pod 'RESideMenu', '~> 4.0.7'

Install into your Xcode project:

$ pod install

Open your project in Xcode from the .xcworkspace file (not the usual project file)

$ open MyProject.xcworkspace

Please note that if your installation fails, it may be because you are installing with a version of Git lower than CocoaPods is expecting. Please ensure that you are running Git >= 1.8.0 by executing git --version. You can get a full picture of the installation details by executing pod install --verbose.

Manual Install

All you need to do is drop RESideMenu files into your project, and add #include "RESideMenu.h" to the top of classes that will use it.

Example Usage

In your AppDelegate's - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions create the view controller and assign content and menu view controllers.

// Create content and menu controllers
//
DEMONavigationController *navigationController = [[DEMONavigationController alloc] initWithRootViewController:[[DEMOHomeViewController alloc] init]];
DEMOLeftMenuViewController *leftMenuViewController = [[DEMOLeftMenuViewController alloc] init];
DEMORightMenuViewController *rightMenuViewController = [[DEMORightMenuViewController alloc] init];

// Create side menu controller
//
RESideMenu *sideMenuViewController = [[RESideMenu alloc] initWithContentViewController:navigationController
                                                                leftMenuViewController:leftMenuViewController
                                                               rightMenuViewController:rightMenuViewController];
sideMenuViewController.backgroundImage = [UIImage imageNamed:@"Stars"];

// Make it a root controller
//
self.window.rootViewController = sideMenuViewController;

Present the menu view controller:

[self.sideMenuViewController presentLeftMenuViewController];

or

[self.sideMenuViewController presentRightMenuViewController];

Switch content view controllers:

#import <RESideMenu/RESideMenu.h>

....

[self.sideMenuViewController setContentViewController:viewController animated:YES];
[self.sideMenuViewController hideMenuViewController];

Storyboards Example

  1. Create a subclass of RESideMenu. In this example we call it DEMORootViewController.
  2. In the Storyboard designate the root view's owner as DEMORootViewController.
  3. Make sure to #import "RESideMenu.h" in DEMORootViewController.h.
  4. Add more view controllers to your Storyboard, and give them identifiers "leftMenuViewController", "rightMenuViewController" and "contentViewController". Note that in the new XCode the identifier is called "Storyboard ID" and can be found in the Identity inspector.
  5. Add a method awakeFromNib to DEMORootViewController.m with the following code:
- (void)awakeFromNib
{
    self.contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"contentViewController"];
    self.leftMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"leftMenuViewController"];
    self.rightMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rightMenuViewController"];
}

Customization

You can customize the following properties of RESideMenu:

@property (assign, readwrite, nonatomic) NSTimeInterval animationDuration;
@property (strong, readwrite, nonatomic) UIImage *backgroundImage;
@property (assign, readwrite, nonatomic) BOOL panGestureEnabled;
@property (assign, readwrite, nonatomic) BOOL panFromEdge;
@property (assign, readwrite, nonatomic) NSUInteger panMinimumOpenThreshold;
@property (assign, readwrite, nonatomic) BOOL interactivePopGestureRecognizerEnabled;
@property (assign, readwrite, nonatomic) BOOL scaleContentView;
@property (assign, readwrite, nonatomic) BOOL scaleBackgroundImageView;
@property (assign, readwrite, nonatomic) BOOL scaleMenuView;
@property (assign, readwrite, nonatomic) BOOL contentViewShadowEnabled;
@property (assign, readwrite, nonatomic) UIColor *contentViewShadowColor;
@property (assign, readwrite, nonatomic) CGSize contentViewShadowOffset;
@property (assign, readwrite, nonatomic) CGFloat contentViewShadowOpacity;
@property (assign, readwrite, nonatomic) CGFloat contentViewShadowRadius;
@property (assign, readwrite, nonatomic) CGFloat contentViewScaleValue;
@property (assign, readwrite, nonatomic) CGFloat contentViewInLandscapeOffsetCenterX;
@property (assign, readwrite, nonatomic) CGFloat contentViewInPortraitOffsetCenterX;
@property (assign, readwrite, nonatomic) CGFloat parallaxMenuMinimumRelativeValue;
@property (assign, readwrite, nonatomic) CGFloat parallaxMenuMaximumRelativeValue;
@property (assign, readwrite, nonatomic) CGFloat parallaxContentMinimumRelativeValue;
@property (assign, readwrite, nonatomic) CGFloat parallaxContentMaximumRelativeValue;
@property (assign, readwrite, nonatomic) CGAffineTransform menuViewControllerTransformation;
@property (assign, readwrite, nonatomic) BOOL parallaxEnabled;
@property (assign, readwrite, nonatomic) BOOL bouncesHorizontally;
@property (assign, readwrite, nonatomic) UIStatusBarStyle menuPreferredStatusBarStyle;
@property (assign, readwrite, nonatomic) BOOL menuPrefersStatusBarHidden;

If you set a backgroundImage, don't forget to set the Menu View Controller's background color to clear color.

You can implement RESideMenuDelegate protocol to receive the following messages:

- (void)sideMenu:(RESideMenu *)sideMenu didRecognizePanGesture:(UIPanGestureRecognizer *)recognizer;
- (void)sideMenu:(RESideMenu *)sideMenu willShowMenuViewController:(UIViewController *)menuViewController;
- (void)sideMenu:(RESideMenu *)sideMenu didShowMenuViewController:(UIViewController *)menuViewController;
- (void)sideMenu:(RESideMenu *)sideMenu willHideMenuViewController:(UIViewController *)menuViewController;
- (void)sideMenu:(RESideMenu *)sideMenu didHideMenuViewController:(UIViewController *)menuViewController;

Contact

Roman Efimov

License

RESideMenu is available under the MIT license.

Copyright © 2013 Roman Efimov.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Issues
  • Quick swiping results in view completely disappearing

    Quick swiping results in view completely disappearing

    When quickly swiping the view controller to the right it sometimes disappears completely, leaving me with only the menu. When selecting a menu item the only thing happening is the statusbar changing color. To get the view controller back i have to shut down the app and relaunch it.

    (This is from the example project)

    Edit: I can replicate it on iOS6 and iOS7

    Example

    opened by Amnell 16
  • support right menu ? just like Facebook last version on ios7

    support right menu ? just like Facebook last version on ios7

    support right menu ? just like Facebook last version on ios7 thanks.

    enhancement 
    opened by liufsd 12
  • "Unbalanced calls to begin/end appearance transitions for " error

    This happens when you drag the view controller horizontally to reveal the menu partly and don't go all the way but go back to the view controller. It causes the navigation view controller to not update when pushing or popping views from the main navigation view controller.

    opened by ankurp 11
  • [RootViewController re_displayController:frame:]: unrecognized selector

    [RootViewController re_displayController:frame:]: unrecognized selector

    I tried to implement storyboard version, but I'm getting exception: [RootViewController re_displayController:frame:]: unrecognized selector sent to instance 0x9880e10

    in RESideMenu.m, line 116. My RootViewController is subclass of RESideMenu, and I don't see any difference between my and demo project :( Do you have idea what can be wrong?

    P.S. Installed via cocoapods

    opened by mladjan 10
  • presentMenuViewController does not show the menu i case i go forward and back

    presentMenuViewController does not show the menu i case i go forward and back

    Currently i implement an eshop, so i push/pop instances of the same ViewController to navigate in products/categories.

    Each ViewController has a menuViewController (both are included to a RESide Menu). When i push and then i pop a ViewController (going back) the presentMenuViewController is not working - does not open the menu controller. Instead the scroll gesture works as expected.

    Do you have any ideas why the "programmatically way" is not working when a viewController is appeared from back stack?

    opened by mspapant 10
  • Positioning issue

    Positioning issue

    It seems that if the menu is used once the positioning of views isn't completely correct anymore. See the lines at the right and bottom of the screenshot. (Note! You can't see it against a white background like here.)

    Or did I miss anything?

    image

    opened by heijmerikx 8
  • Project alive?

    Project alive?

    Hi @romaonthego,

    is this project still alive? There are many PR's that are currently not merged. If you need assistance please ask!

    Best,

    Felix

    opened by x2on 7
  • How to use this if my root view controller is a UITabBarController?

    How to use this if my root view controller is a UITabBarController?

    Hi.

    This is a question, not an issue. What would be the best way to approach the following structure:

    I am using storyboards and my project contains a tab bar controller, which is the root view controller of the application. The main view controller from which this side menu will be accessible contains a navigation bar (along with the tab bar).

    Thanks!

    opened by aseemsandhu 6
  • Swift Port

    Swift Port

    Anybody interested in helping converting this fantastic iOS component to Swift? I have started converting the basic Objective-C to Swift in this branch: https://github.com/SSA111/RESideMenuSwift

    opened by SSA111 6
  • Added support for menu on both sides/right side only

    Added support for menu on both sides/right side only

    Users can now initialize a RESideMenu instance with a menu on each side, or just a menu on the right side.

    I had to make a significant amount of changes and some of the code could using optimizing, such as the gesture recognition. Feedback would be highly appreciated.

    opened by MahirEusufzai 6
  • problem with iOS 13

    problem with iOS 13

    This is not work on ios13.

    All viewDidAppear not called at all

    opened by mobileonekh 1
  • black status bar when open side menu

    black status bar when open side menu

    when I open side menu a black view appears instead of status bar only on iOS 10

    opened by AhmedOsman00 3
  • Container View's frame

    Container View's frame

    Hello Everyone Can we adjust container view's frame when left menu or right menu was opened.

    opened by cjbhojani 0
  • BUG: UI can't show full screen on iPhoneX .

    BUG: UI can't show full screen on iPhoneX .

    There's screenshot below, how should I solve this issue ? Maybe because of safe-area I guess.

    error1 error2
    opened by XiaoWuTongZhi 2
  • 完美解决RESideMenu二级界面能侧滑的bug(即在二级页面关闭侧滑菜单功能)

    完美解决RESideMenu二级界面能侧滑的bug(即在二级页面关闭侧滑菜单功能)

    简书地址:https://www.jianshu.com/p/9769337d297f

    解决方法是用的@icetime17的,只是代码放的位置不太一样,他的RootViewController是继承自RESideMenu的,而我是自己写了个RESideMenu的分类进行设置的。

    关键代码就👇几句:

    -(void)viewWillAppear:(BOOL)animated

    {

    [super viewWillAppear:animated];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(disableRESideMenu) name:@"disableRESideMenu" object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enableRESideMenu) name:@"enableRESideMenu" object:nil];
    

    }

    -(void)enableRESideMenu

    { self.panGestureEnabled = YES;}

    -(void)disableRESideMenu

    { self.panGestureEnabled = NO;}

    分类设置完后,在需要关闭侧滑菜单的界面执行👇

    [[NSNotificationCenter defaultCenter] postNotificationName:@"disableRESideMenu" object:nil];

    为什么我要把代码放在viewWillAppear里呢?

    尝试放在viewDidLoad里面,但是程序运行起来黑屏;

    尝试放在+(void)load方法里面,但是崩在发送通知的方法,提示找不到disableRESideMenu方法,为什么呢?因为+(void)load是类方法,不能在里面直接使用对象方法- (void)enableRESideMenu。

    因此,我尝试了一下放在viewWillAppear里面。。。完美解决!!!

    opened by arr0813 0
  • If you want only one view forced landscape left orientation, others keep portrait. I need to add some code to 'RESideMenu.m'.

    If you want only one view forced landscape left orientation, others keep portrait. I need to add some code to 'RESideMenu.m'.

    The code:

    - (UIInterfaceOrientationMask)supportedInterfaceOrientations
    {
        return [self.contentViewController supportedInterfaceOrientations];
    }
    
    opened by HOWIE-CH 0
  • Changing Orientation

    Changing Orientation

    Hi, i need some help on changing the screen orientation. im not sure how to implement so that it can support landscape orientation. Currently, when i launch the project, the screen is in portrait mode, and nothing happen when i tilt the device. Thanks!

    opened by nanaberry 0
  • how to adjust safe area insets bottom for toolbar

    how to adjust safe area insets bottom for toolbar

    opened by ph4br1c3 0
  • Fix for navigation bar when scaling UINavigationController's view in iOS 11

    Fix for navigation bar when scaling UINavigationController's view in iOS 11

    Fixes #303 by adjusting safe area insets during animations

    opened by howelse 2
  • iOS11 issue on slide-over graphic..

    iOS11 issue on slide-over graphic..

    I noted the other thread with a link to a correction, but it changes the fundamental startup of my app (no proper auto-slide over of my main content view), so i am posting here with a thought, and hope for a suggest to speed up my effort:

    The graphic representing the slid-over content view seems to show the navigation bar to be down too far, about 2-5%. If somebody has an idea why, perhaps related to the new inclusion of AutoLayout in navbar/toolbars, that would be great... thanks.

    opened by wdcurry 2
Releases(4.0.7)
Owner
Roman Efimov
Roman Efimov
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 85 Aug 29, 2021
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 Jan 3, 2022
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.

▤ SideMenu 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 he

Jon Kent 5.3k Jan 1, 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 Jan 7, 2022
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 26, 2021
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 708 Dec 31, 2021
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 Jan 4, 2022
A fully customizable popup style menu for iOS 😎

Guide Check out the documentation and guides for details on how to use. (Available languages:) English 简体中文 What's a better way to know what PopMenu o

Cali Castle 1.3k Jan 5, 2022
A simple circle style menu.

Support CocoaPods. New at 2019.02.25 Use @property (nonatomic, assign) BOOL isOpened; can open or close RoundMenu. use -(void)setButtonEnable:(BOOL)en

zsy78191 385 Dec 5, 2021
Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.

Easy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As

Anatoliy Voropay 20 Apr 11, 2021
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
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 Jan 10, 2022
RadialMenu is a custom control for providing a touch context menu (like iMessage recording in iOS 8) built with Swift & POP

RadialMenu Looking for help? For $150/hr I'll help with your RadialMenu problems including integrating it into your project. Email [email protected] t

Brad Jasper 296 Nov 16, 2021
The fastest zero-tap iOS menu.

⚡️ Quicklook The fastest zero-tap iOS menu CariocaMenu is a simple, elegant, fast navigation menu for your iOS apps. ?? Features Accessible from a sin

momo 789 Nov 19, 2021
Context menu similar to the one in the Pinterest iOS app

VLDContextSheet A clone of the Pinterest iOS app context menu. Example Usage VLDContextSheetItem *item1 = [[VLDContextSheetItem alloc] initWithTitle:

Vladimir Angelov 173 Jun 9, 2021
A menu based on Medium iOS app.

Notice: MediumMenu is no longer being maintained/updated. MediumMenu Medium 1.8.168 menu in Swift. That is still one of my favorite menus because that

Hiroki Nagasawa 322 Dec 19, 2021
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 588 Dec 7, 2021
🔻 Dropdown Menu for iOS with many customizable parameters to suit any needs

MKDropdownMenu Dropdown Menu for iOS with many customizable parameters to suit any needs. Inspired by UIPickerView. Installation CocoaPods MKDropdownM

Max Konovalov 525 Jan 12, 2022
ExpandingMenu is menu button for iOS written in Swift.

ExpandingMenu ExpandingMenu is written in Swift. Requirements iOS 8.0+ Xcode 10.0+ Swift 3.x+ Installation CocoaPods You can install CocoaPods with th

null 452 Dec 29, 2021